From 4f103772557be082199f459640f5fda0db002d88 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 2 Oct 2025 14:24:45 -0400 Subject: [PATCH] fix types --- lua/cp/ui/panel.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/cp/ui/panel.lua b/lua/cp/ui/panel.lua index 60026b2..7b100f2 100644 --- a/lua/cp/ui/panel.lua +++ b/lua/cp/ui/panel.lua @@ -62,7 +62,10 @@ function M.toggle_interactive() local cache = require('cp.cache') cache.load() local contest_data = cache.get_contest_data(platform, contest_id) - if contest_data and not contest_data.interactive then + if + contest_data + and not (contest_data or {}).problems[contest_data.index_map[state.get_current_problem_id]].interactive + then logger.log('This is NOT an interactive problem. Use :CP run instead.', vim.log.levels.WARN) return end @@ -154,7 +157,10 @@ function M.toggle_run_panel(is_debug) local cache = require('cp.cache') cache.load() local contest_data = cache.get_contest_data(platform, contest_id) - if contest_data and contest_data.interactive then + if + contest_data + and not (contest_data or {}).problems[contest_data.index_map[state.get_current_problem_id]].interactive + then logger.log('This is an interactive problem. Use :CP interact instead.', vim.log.levels.WARN) return end