diff --git a/init.lua b/init.lua index 6104584..34526d9 100644 --- a/init.lua +++ b/init.lua @@ -24,7 +24,7 @@ local save_bookmark = ya.sync(function(state, idx) cursor = folder.cursor, } - if state.notify.enable then + if state.notify and state.notify.enable then local message = state.notify.message.new message, _ = message:gsub("", SUPPORTED_KEYS[idx].on) message, _ = message:gsub("", tostring(folder.cwd)) @@ -39,7 +39,7 @@ end) local all_bookmarks = ya.sync(function(state) return state.bookmarks or {} end) local delete_bookmark = ya.sync(function(state, idx) - if state.notify.enable then + if state.notify and state.notify.enable then local message = state.notify.message.delete message, _ = message:gsub("", state.bookmarks[idx].on) message, _ = message:gsub("", state.bookmarks[idx].desc) @@ -56,7 +56,7 @@ end) local delete_all_bookmarks = ya.sync(function(state) state.bookmarks = nil - if state.notify.enable then + if state.notify and state.notify.enable then ya.notify { title = "Bookmarks", content = state.notify.message.delete_all,