open_plugins bugfix failure to save

if you added a plugin through the core settings and then used the shortcut
immediately the entry would never get flushed to disk

Change-Id: I62e876bbf0a8fa96acba1cc2582e2563401547f1
This commit is contained in:
William Wilgus 2021-08-02 01:40:18 -04:00 committed by William Wilgus
parent 0501af8b06
commit 3b6c3d769f
2 changed files with 12 additions and 9 deletions

View file

@ -848,7 +848,7 @@ void root_menu(void)
}
}
open_plugin_get_entry(key, &open_plugin_entry);
bool flush = (open_plugin_get_entry(key, &open_plugin_entry) == -2);
char *path = open_plugin_entry.path;
char *param = open_plugin_entry.param;
if (param[0] == '\0')
@ -856,7 +856,7 @@ void root_menu(void)
next_screen = load_plugin_screen(path, param);
if (next_screen != GO_TO_PLUGIN)
if (!flush && next_screen != GO_TO_PLUGIN)
open_plugin_add_path(NULL, NULL, NULL);
/* shortcuts may take several trips through the GO_TO_PLUGIN case