diff --git a/main.lua b/main.lua index 9ac48fe..d842540 100644 --- a/main.lua +++ b/main.lua @@ -1,5 +1,6 @@ local Device = require("device") local InputContainer = require("ui/widget/container/inputcontainer") +local NetworkMgr = require("ui/network/manager") local _ = require("gettext") local showChatGPTDialog = require("dialogs") @@ -15,7 +16,7 @@ function AskGPT:init() text = _("Ask ChatGPT"), enabled = Device:hasClipboard(), callback = function() - showChatGPTDialog(self.ui, _reader_highlight_instance.selected_text.text) + NetworkMgr:runWhenOnline(function() showChatGPTDialog(self.ui, _reader_highlight_instance.selected_text.text) end) end, } end)