Skip to content

Sharing state between active windows#975

Open
filipslezaklab wants to merge 4 commits into
devfrom
ui-fixes
Open

Sharing state between active windows#975
filipslezaklab wants to merge 4 commits into
devfrom
ui-fixes

Conversation

@filipslezaklab

Copy link
Copy Markdown
Contributor
  • ui fixes

@filipslezaklab filipslezaklab self-assigned this Jun 17, 2026

listen<AddInstanceEventPayload>(TauriEvent.AddInstance, (event) => {
console.log('[TauriEvent] AddInstance (instances invalidation)', event.payload);
void debug(`UI Received event AddInstance: ${JSON.stringify(event.payload)}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logs the refresh token on disk which should be avoided

const unlisteners = Promise.all([
listen<AddInstanceEventPayload>(TauriEvent.AddInstance, (event) => {
console.log('[TauriEvent] AddInstance', event.payload);
void debug(`UI Received event AddInstance: ${JSON.stringify(event.payload)}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logs the refresh token on disk which should be avoided

const current = sessionState?.location_mfa_preference ?? {};
api
.patchSessionState({
location_mfa_preference: { ...current, [String(locationId)]: method },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider a backend command to update the method for a specific location instead of replacing the whole map.

setLocationMfaPreference(location.id, selectedMethod);
if (setAsDefault && selectedMethod !== locationDefaultMfaMethod && location) {
setMfaMethod({ locationId: location.id, mfaMethod: selectedMethod });
} else {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty else block

pub async fn patch_session_state(
patch: SessionStatePatch,
app_handle: AppHandle,
) -> Result<SessionState, ()> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop the Result if we don't actually ever return an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants