From 0741ec2fdcd9b3f378eaabdbdb656b31b0eafc7c Mon Sep 17 00:00:00 2001 From: Ofek Shilon Date: Sat, 11 May 2024 17:29:11 +0300 Subject: [PATCH] Fix: page refresh restores default code --- static/main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/main.ts b/static/main.ts index 9e78ec7f3..c44d51514 100644 --- a/static/main.ts +++ b/static/main.ts @@ -369,7 +369,9 @@ function findConfig(defaultConfig: ConfigType, options: CompilerExplorerOptions, const savedState = sessionThenLocalStorage.get('gl', null); if (savedState) config = JSON.parse(savedState); } - if (!config.layout || !config.layout.content || config.layout.content === 0) config = defaultConfig; + if (!config.content || config.content.length === 0) { + config = defaultConfig; + } } } else { config = _.extend(