mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 02:34:12 -04:00
Merge pull request #4693 from nextcloud/fix_4644
Do not reload the filelist on first open
This commit is contained in:
commit
b66dfa909b
2 changed files with 16 additions and 1 deletions
|
|
@ -91,6 +91,12 @@
|
|||
*/
|
||||
initialized: false,
|
||||
|
||||
/**
|
||||
* Wheater the file list was already shown once
|
||||
* @type boolean
|
||||
*/
|
||||
shown: false,
|
||||
|
||||
/**
|
||||
* Number of files per page
|
||||
*
|
||||
|
|
@ -557,7 +563,10 @@
|
|||
* Event handler when leaving previously hidden state
|
||||
*/
|
||||
_onShow: function(e) {
|
||||
this.reload();
|
||||
if (this.shown) {
|
||||
this.reload();
|
||||
}
|
||||
this.shown = true;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1509,6 +1509,12 @@ describe('OCA.Files.FileList tests', function() {
|
|||
});
|
||||
it('reloads the list when leaving hidden state', function() {
|
||||
var reloadStub = sinon.stub(fileList, 'reload');
|
||||
|
||||
// First show should not trigger
|
||||
$('#app-content-files').trigger(new $.Event('show'));
|
||||
expect(reloadStub.calledOnce).toEqual(false);
|
||||
|
||||
// Second show should!
|
||||
$('#app-content-files').trigger(new $.Event('show'));
|
||||
expect(reloadStub.calledOnce).toEqual(true);
|
||||
reloadStub.restore();
|
||||
|
|
|
|||
Loading…
Reference in a new issue