···3import { goto } from "../utils/tools.ts";
45Alpine.data("settingsPageState", () => ({
6- location_on: Store.get("is_sharing"),
000078 async debugLogout() {
9 await Store.reset();
···18 // once i finish this here, i'll move it over to api maybe? i'll have to check with azom
1920 await Store.set("is_sharing", !(await Store.get("is_sharing")));
21- this.location_on = Store.get("is_sharing");
22 },
23}));
24
···3import { goto } from "../utils/tools.ts";
45Alpine.data("settingsPageState", () => ({
6+ async init() {
7+ this.location_on = await Store.get("is_sharing");
8+ },
9+10+ location_on: true,
1112 async debugLogout() {
13 await Store.reset();
···22 // once i finish this here, i'll move it over to api maybe? i'll have to check with azom
2324 await Store.set("is_sharing", !(await Store.get("is_sharing")));
25+ this.location_on = await Store.get("is_sharing");
26 },
27}));
28
+31-5
app/src/signup-page/signup.html
···1819 <!-- x-data connects this element to the signupPageState Alpine component, enabling its data (serverAddress and signupKey) and functions (signup and scanQR) to work within it :) -->
20 <!-- TODO: make this a form instead? -->
0021 <div class="actions" x-data="signupPageState">
22 <div>
23 <label for="server">Server Address</label>
24- <input id="server" type="url" placeholder="https://your-server.com" x-model="serverAddress" required />
00000025 </div>
2627 <div>
28 <label for="key">Signup Key</label>
29- <input id="key" type="password" placeholder="Enter your signup key" x-model="signupKey" required />
00000030 </div>
3132- <p class="hint">Scan a QR code to automatically fill both server address and signup key</p>
33- <button type="button" x-bind:disabled="isDoingStuff" class="btn-qr" @click="await scanQR()">
0000000034 <img src="/src/assets/qr.svg" alt="QR Icon" />
35 Scan QR Code
36 </button>
3738- <button class="btn-primary" x-bind:disabled="isDoingStuff" @click="await signup()">
000039 <span x-show="isDoingStuff">Connecting...</span>
40 <span x-show="!isDoingStuff">Connect</span>
41 </button>
···1819 <!-- x-data connects this element to the signupPageState Alpine component, enabling its data (serverAddress and signupKey) and functions (signup and scanQR) to work within it :) -->
20 <!-- TODO: make this a form instead? -->
21+22+ <!-- <input type="text" @keyup.shift.enter="alert('Submitted!')"> use something like this to submit? -->
23 <div class="actions" x-data="signupPageState">
24 <div>
25 <label for="server">Server Address</label>
26+ <input
27+ id="server"
28+ type="url"
29+ placeholder="https://your-server.com"
30+ x-model="serverAddress"
31+ required
32+ />
33 </div>
3435 <div>
36 <label for="key">Signup Key</label>
37+ <input
38+ id="key"
39+ type="password"
40+ placeholder="Enter your signup key"
41+ x-model="signupKey"
42+ required
43+ />
44 </div>
4546+ <p class="hint">
47+ Scan a QR code to automatically fill both server address and
48+ signup key
49+ </p>
50+ <button
51+ type="button"
52+ x-bind:disabled="isDoingStuff"
53+ class="btn-qr"
54+ @click="await scanQR()"
55+ >
56 <img src="/src/assets/qr.svg" alt="QR Icon" />
57 Scan QR Code
58 </button>
5960+ <button
61+ class="btn-primary"
62+ x-bind:disabled="isDoingStuff"
63+ @click="await signup()"
64+ >
65 <span x-show="isDoingStuff">Connecting...</span>
66 <span x-show="!isDoingStuff">Connect</span>
67 </button>