Skip to content

Commit

Permalink
Restore latest imagery used from local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
bagage committed Jan 21, 2018
1 parent b69ce83 commit 5077f88
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/renderer/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ export function rendererBackground(context) {
background.baseLayerSource(
background.findSource(requested) ||
best ||
background.findSource(context.storage('background-last-used')) ||
background.findSource('Bing') ||
first ||
background.findSource('none')
Expand Down
4 changes: 3 additions & 1 deletion modules/ui/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function uiBackground(context) {
var key = t('background.key');

var _customSource = context.background().findSource('custom');
var _previousBackground;
var _previousBackground = context.background().findSource(context.storage('background-previous-last-used'));
var _shown = false;

var _backgroundList = d3_select(null);
Expand Down Expand Up @@ -92,6 +92,8 @@ export function uiBackground(context) {

d3_event.preventDefault();
_previousBackground = context.background().baseLayerSource();
context.storage('background-previous-last-used', _previousBackground.id);
context.storage('background-last-used', d.id);
context.background().baseLayerSource(d);
_backgroundList.call(updateLayerSelections);
document.activeElement.blur();
Expand Down

0 comments on commit 5077f88

Please sign in to comment.