Skip to content

Commit

Permalink
Merge pull request #11 from nihaals/wifi-disabled
Browse files Browse the repository at this point in the history
fix: Fix crash when Wi-Fi is disabled
  • Loading branch information
drewbaumann authored Aug 11, 2024
2 parents a18fe4c + 311ccb0 commit 37510ec
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 37510ec

Please sign in to comment.