feat: show plugin diagnostics only in debug mode
This commit is contained in:
parent
c567b229cc
commit
4db5a7a132
|
|
@ -219,6 +219,7 @@
|
|||
const settings = await App.GetAppSettings();
|
||||
debug.log('[App] checkVault: GetAppSettings returned', settings);
|
||||
flog('checkVault: GetAppSettings returned');
|
||||
if (settings?.debug) debug.enable();
|
||||
|
||||
debug.log('[App] checkVault: calling GetVaultStatus...');
|
||||
vaultStatus = await App.GetVaultStatus() || { status: 'unknown', path: '', vaultId: '' };
|
||||
|
|
|
|||
|
|
@ -2067,6 +2067,7 @@ func (a *App) GetAppSettings() map[string]interface{} {
|
|||
"theme": cfg.Theme,
|
||||
"language": cfg.Language,
|
||||
"devMode": cfg.DevMode,
|
||||
"debug": a.debug,
|
||||
"userPluginsDir": cfg.UserPluginsDir,
|
||||
"lastOpenedAt": cfg.LastOpenedAt,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1791,11 +1791,14 @@ func TestAppSettingsLanguageAPI(t *testing.T) {
|
|||
if err := settings.Update(&appsettings.Config{Theme: "light", DevMode: true}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
app := &App{appSettings: settings}
|
||||
app := &App{appSettings: settings, debug: true}
|
||||
|
||||
if got := app.GetAppSettings()["language"]; got != "system" {
|
||||
t.Fatalf("initial language = %#v, want system", got)
|
||||
}
|
||||
if got := app.GetAppSettings()["debug"]; got != true {
|
||||
t.Fatalf("debug = %#v, want true", got)
|
||||
}
|
||||
if errStr := app.UpdateAppSettings(map[string]interface{}{"language": "ru"}); errStr != "" {
|
||||
t.Fatalf("UpdateAppSettings language: %s", errStr)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue