Make reindex button work; no feedback yet

custom
jacqueline 1 year ago
parent 71b4673039
commit a4d03fc704
  1. 8
      lua/settings.lua
  2. 9
      src/lua/lua_database.cpp

@ -6,6 +6,7 @@ local volume = require("volume")
local display = require("display") local display = require("display")
local controls = require("controls") local controls = require("controls")
local bluetooth = require("bluetooth") local bluetooth = require("bluetooth")
local database = require("database")
local settings = {} local settings = {}
@ -74,7 +75,6 @@ function settings.bluetooth()
local clear_paired = paired_container:Button {} local clear_paired = paired_container:Button {}
clear_paired:Label { text = "x" } clear_paired:Label { text = "x" }
clear_paired:onClicked(function() clear_paired:onClicked(function()
print("clear dev")
bluetooth.paired_device:set() bluetooth.paired_device:set()
end) end)
@ -277,9 +277,9 @@ function settings.database()
local update = actions_container:Button {} local update = actions_container:Button {}
update:Label { text = "Update" } update:Label { text = "Update" }
update:onClicked(function()
local recreate = actions_container:Button {} database.update()
recreate:Label { text = "Recreate" } end)
end end
function settings.firmware() function settings.firmware()

@ -95,10 +95,19 @@ static auto size(lua_State* L) -> int {
} }
static auto recreate(lua_State* L) -> int { static auto recreate(lua_State* L) -> int {
ESP_LOGI(kTag, "recreate");
return 0; return 0;
} }
static auto update(lua_State* L) -> int { static auto update(lua_State* L) -> int {
Bridge* instance = Bridge::Get(L);
auto db = instance->services().database().lock();
if (!db) {
return 0;
}
instance->services().bg_worker().Dispatch<void>(
[=]() { db->updateIndexes(); });
return 0; return 0;
} }

Loading…
Cancel
Save