1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-07 09:15:50 +02:00

Reset script cache when holding Shift during browser reload

This commit is contained in:
chylex 2018-08-24 16:34:55 +02:00
parent 7a976edc82
commit fa4beea425
2 changed files with 11 additions and 2 deletions

View File

@ -15,6 +15,7 @@
using TweetDuck.Core.Utils;
using TweetDuck.Plugins;
using TweetDuck.Plugins.Events;
using TweetDuck.Resources;
using TweetDuck.Updates;
namespace TweetDuck.Core{
@ -365,7 +366,11 @@ public void ReinjectCustomCSS(string css){
public void ReloadToTweetDeck(){
#if DEBUG
Resources.ScriptLoader.HotSwap();
ScriptLoader.HotSwap();
#else
if (ModifierKeys.HasFlag(Keys.Shift)){
ScriptLoader.ClearCache();
}
#endif
ignoreUpdateCheckError = false;

View File

@ -80,6 +80,10 @@ public static void ExecuteScript(IFrame frame, string script, string identifier)
}
}
public static void ClearCache(){
CachedData.Clear();
}
private static void ShowLoadError(Control sync, string message){
sync?.InvokeSafe(() => FormMessage.Error("Resource Error", message, FormMessage.OK));
}
@ -128,7 +132,7 @@ public static void HotSwap(){
sw.Stop();
Debug.WriteLine("Finished rebuild script in "+sw.ElapsedMilliseconds+" ms");
CachedData.Clear();
ClearCache();
// Force update plugin manager setup scripts