From 3d4f04860b2ba6b517733f228b79ce164ed1ffa1 Mon Sep 17 00:00:00 2001 From: Tipx-L <138244655+Tipx-L@users.noreply.github.com> Date: Thu, 24 Aug 2023 08:19:48 -0700 Subject: [PATCH] Optimize game.showExtensionChangeLog. (cherry picked from commit c5eeb67e390a232b1a577d2c04a72f4119592754) --- game/game.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/game/game.js b/game/game.js index 092ac4731..5ada22873 100644 --- a/game/game.js +++ b/game/game.js @@ -38376,16 +38376,14 @@ lib.init.onfree(); } }, - showExtensionChangeLog:function(str,extname){ + showExtensionChangeLog:(str,extname)=>{ extname=extname||_status.extension; - var cfg='extension_'+extname+'_changelog'; - if(lib.extensionPack[extname]&&lib.extensionPack[extname].version!=lib.config[cfg]){ - game.saveConfig(cfg,lib.extensionPack[extname].version); - if(!_status.extensionChangeLog){ - _status.extensionChangeLog={}; - _status.extensionChangeLog[extname]=str; - } - } + const cfg=`extension_${extname}_changelog`; + if(!lib.extensionPack[extname]||lib.extensionPack[extname].version==lib.config[cfg]) return; + game.saveConfig(cfg,lib.extensionPack[extname].version); + if(_status.extensionChangeLog) return; + _status.extensionChangeLog={}; + _status.extensionChangeLog[extname]=str; }, saveConfig:(key,value,local,callback)=>{ if(_status.reloading) return;