From df28f9b0720293ee02db82bbcbe6f0548d8d777c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=9C=D0=B0?= =?UTF-8?q?=D0=BA=D0=B0=D1=80=D0=BE=D0=B2?= Date: Sun, 21 Mar 2021 15:09:44 +0700 Subject: [PATCH] Fixed crash when launching on new api --- AnimateMate.sketchplugin/Contents/Sketch/library/Utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AnimateMate.sketchplugin/Contents/Sketch/library/Utils.js b/AnimateMate.sketchplugin/Contents/Sketch/library/Utils.js index 848b192..0b4bc73 100755 --- a/AnimateMate.sketchplugin/Contents/Sketch/library/Utils.js +++ b/AnimateMate.sketchplugin/Contents/Sketch/library/Utils.js @@ -1,3 +1,4 @@ +const Settings = require('sketch/settings'); @import 'library/easing.js'; @import 'library/Animate.js'; @@ -34,7 +35,6 @@ Utils.prototype.init = function (context, loopNestedGroups, forceContinue) { this.page = this.doc.currentPage(); this.artboard = this.page.currentArtboard(); this.allLayersActive = false; - this.api = context.api(); if (this.artboard) { @@ -88,12 +88,12 @@ Utils.prototype.init = function (context, loopNestedGroups, forceContinue) { Utils.prototype.getKeyframeNumber = function() { - return this.api.settingForKey('AnimateMateFrame') || 0; + return Settings.settingForKey('AnimateMateFrame') || 0; } Utils.prototype.setKeyframeNumber = function(keyframe) { log('saved keyframe'+ keyframe); - this.api.setSettingForKey('AnimateMateFrame', keyframe); + Settings.setSettingForKey('AnimateMateFrame', keyframe); } // ---------------------------------------- //