fix types

This commit is contained in:
Barrett Ruth 2025-10-02 14:24:45 -04:00
parent db98153b11
commit 4f10377255

View file

@ -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