Skip to content

Commit

Permalink
fix overwriting ArtboardHistory when resetting it
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-patrick committed May 3, 2019
1 parent 596e0ac commit 6d23c3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export function resetAllSetSettings() {
setSetting("lastArtboard", "")
setSetting("actualArtboard", "")
setSetting("ArtboardHistory", "")
newArtboardHistoryObject()
sendMessageToBottom("Everything resetted. Hopefully 😇")
}

Expand Down Expand Up @@ -161,14 +162,18 @@ export function checkIfAllThisExists() {
checkIfArtboardHistoryAlreadySaved()
}

function newArtboardHistoryObject() {
var artboardHistory = {
zoom: true,
documents: []
}
setSetting("ArtboardHistory", artboardHistory)
}

function checkIfArtboardHistoryAlreadySaved() {
var a = getSavedSetting("ArtboardHistory")
if (typeof a != "object") {
var artboardHistory = {
zoom: true,
documents: []
}
setSetting("ArtboardHistory", artboardHistory)
newArtboardHistoryObject()
}
//sendErrorMessage(objectToJson(getSavedSetting("ArtboardHistory")))
}
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "https://github.com/jan-patrick/sketch_artboard-history",
"compatibleVersion": 54.1,
"bundleVersion": 1,
"version": "1.5.0",
"version": "1.5.1",
"identifier": "com.github.jan-patrick.sketch_artboard-history",
"icon": "icon.png",
"suppliesData": false,
Expand Down

0 comments on commit 6d23c3f

Please sign in to comment.