@@ -4993,6 +4997,34 @@ async function renderRecordingInline(container) {
};
btnWrap.appendChild(followBtn);
+ // Left-side group (bottom-left, opposite the right controls): live-location toggle + SMS.
+ // Live sharing can be switched on/off right here even if it was never set in the profile.
+ let liveBtn = document.createElement("button");
+ liveBtn.className = "rec-map-btn rec-live-btn";
+ liveBtn.textContent = "LIVE";
+ liveBtn.title = "Трансляция местоположения вкл/выкл";
+ let liveOn = localStorage.getItem("baldav_live_on") === "1";
+ liveBtn.classList.toggle("active", liveOn);
+ liveBtn.onclick = async () => {
+ liveOn = !liveOn;
+ localStorage.setItem("baldav_live_on", liveOn ? "1" : "0");
+ liveBtn.classList.toggle("active", liveOn);
+ let url = localStorage.getItem("baldav_live_url") || "https://4aiman.top/api/trackme/push";
+ let token = localStorage.getItem("baldav_live_token") || "";
+ try { await window.__TAURI__.core.invoke("set_live_config", { enabled: liveOn, url, token }); }
+ catch (e) { console.error("live toggle", e); }
+ if (liveOn && !token) appAlert("Трансляция включена, но токен не задан в профиле - точки не уйдут, пока не впишешь токен.");
+ };
+ btnWrap.appendChild(liveBtn);
+
+ // SMS "я тут" button
+ let smsBtn = document.createElement("button");
+ smsBtn.className = "rec-map-btn rec-sms-btn";
+ smsBtn.textContent = "СМС";
+ smsBtn.title = "Отправить СМС с местоположением";
+ smsBtn.onclick = () => sendLocationSms();
+ btnWrap.appendChild(smsBtn);
+
// Roads toggle button. Roads are viewport-culled onto a canvas pane (only the segments in
// view are drawn, redrawn on pan/zoom) so a huge road network doesn't jank the WebView.
let roadsBtn = document.createElement("button");
@@ -5319,10 +5351,6 @@ async function renderRecordingInline(container) {
}
};
- // SMS "я тут" button — only present when a contact number is configured
- let smsBtn = container.querySelector("#rec-sms");
- if (smsBtn) smsBtn.onclick = () => sendLocationSms();
-
// Stop button
container.querySelector("#rec-stop").onclick = async () => {
if (GPS.recording._compassCleanup) GPS.recording._compassCleanup();
@@ -8279,7 +8307,7 @@ function showProfileModal() {
Делиться местоположением онлайн
Пока включено, во время записи заезда телефон отправляет текущую точку на сервер раз в 10 секунд. Видно только тем, кому дан доступ, и только после входа. Выключается здесь же.
-
+
diff --git a/src-tauri/gen/android/app/src/main/java/dev/baldav/app/LiveShare.kt b/src-tauri/gen/android/app/src/main/java/dev/baldav/app/LiveShare.kt
index 48497f4..a767850 100644
--- a/src-tauri/gen/android/app/src/main/java/dev/baldav/app/LiveShare.kt
+++ b/src-tauri/gen/android/app/src/main/java/dev/baldav/app/LiveShare.kt
@@ -47,7 +47,8 @@ object LiveShare {
// Latest fix from the GPS flush loop (every ~10s). Non-blocking: the network call runs on a
// throwaway thread so it never stalls the main looper that drives GPS delivery.
fun tick(ctx: Context, lat: Double, lon: Double, speed: Float, fixTs: Long) {
- if (!loaded) readCfg(ctx)
+ // re-read every tick so toggling the record-screen LIVE button takes effect within ~10s
+ readCfg(ctx)
if (!enabled || url.isBlank() || token.isBlank()) return
if (lat == 0.0 && lon == 0.0) return // no fix yet
val now = System.currentTimeMillis()