Self-hosted, federated location sharing app and server that prioritizes user privacy and security
end-to-end-encryption location-sharing privacy self-hosted federated

Adds button to toggle location sharing in store (next is making it a switch)

+27 -2
+14 -2
app/src/settings-page/settings.html
··· 11 11 <div class="actions" x-data="settingsPageState"> 12 12 <h3>Settings</h3> 13 13 14 - <button class="btn-primary" @click="goto('home')">Back to Home</button> 14 + <div> 15 + Location Sharing 16 + <button 17 + x-text="location_on" 18 + @click="toggleLocation()" 19 + ></button> 20 + </div> 15 21 16 - <button class="btn-secondary" @click="await debugLogout()">Signout</button> 22 + <button class="btn-primary" @click="goto('home')"> 23 + Back to Home 24 + </button> 25 + 26 + <button class="btn-secondary" @click="await debugLogout()"> 27 + Signout 28 + </button> 17 29 </div> 18 30 </div> 19 31 </body>
+10
app/src/settings-page/settings.ts
··· 3 3 import { goto } from "../utils/tools.ts"; 4 4 5 5 Alpine.data("settingsPageState", () => ({ 6 + location_on: Store.get("is_sharing"), 7 + 6 8 async debugLogout() { 7 9 await Store.reset(); 8 10 goto("signup"); 9 11 }, 12 + 10 13 goto(newLocation: string) { 11 14 goto(newLocation); 15 + }, 16 + 17 + async toggleLocation() { 18 + // once i finish this here, i'll move it over to api maybe? i'll have to check with azom 19 + 20 + await Store.set("is_sharing", !(await Store.get("is_sharing"))); 21 + this.location_on = Store.get("is_sharing"); 12 22 }, 13 23 })); 14 24
+2
app/src/utils/api.ts
··· 33 33 await Store.set("priv_key", bufToBase64(privKeyRaw)); 34 34 await Store.set("friends", []); 35 35 36 + await Store.set("is_sharing", true); // i'm adding this so it works in settings, i think it's more user friendly to have the location to be on by default, but... less privacy friendly? wait no.. nvm. it won't share location with the server since they don't have any added friends yet :) 37 + 36 38 return json; 37 39 } 38 40
+1
app/src/utils/store.ts
··· 6 6 friends: { name: string; id: string }[]; 7 7 is_admin: boolean; 8 8 priv_key: string; 9 + is_sharing: boolean; 9 10 }; 10 11 11 12 export const Store = {