Skip to content

Commit

Permalink
Fix crash when Wi-Fi is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaals authored Jul 14, 2024
1 parent a18fe4c commit 311ccb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.lua
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit 311ccb0

Please sign in to comment.