From 7761c7c75983e8901b3e2611b358148f41b51a2b Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 30 Sep 2025 21:21:13 -0400 Subject: [PATCH] fix(cache): file state --- lua/cp/cache.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/cp/cache.lua b/lua/cp/cache.lua index bab413e..c98fedb 100644 --- a/lua/cp/cache.lua +++ b/lua/cp/cache.lua @@ -240,6 +240,10 @@ end ---@param problem_id? string ---@param language? string function M.set_file_state(file_path, platform, contest_id, problem_id, language) + if not cache_data.file_states then + cache_data.file_states = {} + end + cache_data.file_states[file_path] = { platform = platform, contest_id = contest_id, @@ -284,7 +288,10 @@ function M.clear_contest_list(platform) end function M.clear_all() - cache_data = {} + cache_data = { + file_states = {}, + contest_lists = {}, + } M.save() end