feat(staging): adding support of app-side service and settings app (part 1)

This commit is contained in:
Savely Savianok
2024-12-21 17:56:45 +03:00
parent f16700a9db
commit f21678b219
5 changed files with 54 additions and 68 deletions

View File

@@ -1,13 +1,13 @@
import { gettext } from 'i18n'
AppSideService({
onInit() {
console.log(gettext('example'))
},
onRun() {
},
onDestroy() {
}
})
AppSideService(
{
onInit(){
settings.settingsStorage.addListener('change', async ({ key, newValue, oldValue }) => {
console.log(key)
console.log(newValue)
const totps = settings.settingsStorage.getItem('TOTPs')
const dataBuffer = Buffer.from(totps)
messaging.peerSocket.send(dataBuffer.buffer)
})
}
}
)