Skip to content

Commit

Permalink
don't default current picture
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCoker committed Nov 6, 2017
1 parent 0ec9b96 commit 6611189
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions lib/pictures.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,9 @@ class Pictures extends EventEmitter {
this.$list = newList;
delete this.$map;

// reset current
// reset current if set before
if (this.$cur != null)
this.$cur = this.byFile(this.$cur.file);
if (this.$cur == null)
this.switch(this.$list[0]);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions spec/pictures_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ describe("pictures", function() {
it("setup", function() {
pictures = new Pictures(SAMPLES);
pictures.reload();
pictures.switch(pictures.byIndex(0));
});
it("save 1", function() {
pictures.saveHistory();
Expand Down Expand Up @@ -197,6 +198,7 @@ describe("pictures", function() {
events.push(p);
});
pictures.reload();
pictures.switch(pictures.byIndex(0));
});
it("initial event", function() {
expect(events.length).toBe(1);
Expand Down

0 comments on commit 6611189

Please sign in to comment.