mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-04 18:34:02 +00:00
style: format remaining owned runtime modules
This commit is contained in:
1 parent
ae99843c14
commit
2aca7aecbb
94 files changed
+8865
-3151
No files matched your search
@@ -75,11 +75,16 @@ export function contactsDetectionEnterPlan(current, restore) {
|
||||
* @returns {?{mode: string, densityPct: ?number}} State to replay, or null when
|
||||
* there is nothing to do.
|
||||
*/
|
||||
export function contactsDetectionExitPlan(restore, current, styleOwnsDetection = false) {
|
||||
export function contactsDetectionExitPlan(
|
||||
restore,
|
||||
current,
|
||||
styleOwnsDetection = false,
|
||||
) {
|
||||
if (!restore || styleOwnsDetection) return null;
|
||||
const saved = normalizeDetectionState(restore);
|
||||
const now = normalizeDetectionState(current);
|
||||
if (saved.mode === now.mode && saved.densityPct === now.densityPct) return null;
|
||||
if (saved.mode === now.mode && saved.densityPct === now.densityPct)
|
||||
return null;
|
||||
return saved;
|
||||
}
|
||||
|
||||
@@ -119,7 +124,11 @@ export function applyContactsDetection({
|
||||
if (plan.turnOn) applyPreset();
|
||||
return { restore: plan.restore, changed: plan.turnOn };
|
||||
}
|
||||
const plan = contactsDetectionExitPlan(restore, getState(), styleOwnsDetection);
|
||||
const plan = contactsDetectionExitPlan(
|
||||
restore,
|
||||
getState(),
|
||||
styleOwnsDetection,
|
||||
);
|
||||
if (plan) restoreState(plan);
|
||||
return { restore: null, changed: Boolean(plan) };
|
||||
}
|
||||
@@ -145,7 +154,9 @@ export function shareableDetectionState({ owned, liveMode, liveDensityPct }) {
|
||||
if (!owned) return { mode: liveMode, densityPct: liveDensityPct };
|
||||
return {
|
||||
mode: owned.mode ?? liveMode,
|
||||
densityPct: Number.isFinite(owned.densityPct) ? owned.densityPct : liveDensityPct,
|
||||
densityPct: Number.isFinite(owned.densityPct)
|
||||
? owned.densityPct
|
||||
: liveDensityPct,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user