mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
fix(app): smooth the fluxer.com migration and expired re-login (#3019)
This commit is contained in:
1 parent
a728be4062
commit
c9ae5b6ee8
75 files changed
+3284
-2368
No files matched your search
@@ -2,15 +2,11 @@
|
||||
|
||||
import RuntimeConfig from '@app/features/app/state/RuntimeConfig';
|
||||
import {getDataFlx, getImageSizingProps} from '@app/features/ui/components/icons/BrandImageUtils';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
import {APPLICATION_ICON_DESCRIPTOR, FluxerIconMark} from '@app/features/ui/components/icons/FluxerIconMark';
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {observer} from 'mobx-react-lite';
|
||||
import type React from 'react';
|
||||
|
||||
const APPLICATION_ICON_DESCRIPTOR = msg({
|
||||
message: '{productName} application icon',
|
||||
comment: 'Accessible label for the Fluxer application icon.',
|
||||
});
|
||||
export const FluxerIcon = observer((props: React.SVGProps<SVGSVGElement>) => {
|
||||
const {i18n} = useLingui();
|
||||
const ariaLabel = i18n._(APPLICATION_ICON_DESCRIPTOR, {productName: RuntimeConfig.productName});
|
||||
@@ -24,21 +20,5 @@ export const FluxerIcon = observer((props: React.SVGProps<SVGSVGElement>) => {
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 512 512"
|
||||
role="img"
|
||||
aria-label={ariaLabel}
|
||||
data-flx="ui.icons.fluxer-icon.img"
|
||||
{...props}
|
||||
>
|
||||
<rect fill="var(--brand-primary)" height={512} rx={256} width={512} data-flx="ui.icons.fluxer-icon.rect" />
|
||||
<path
|
||||
fill="var(--brand-primary-fill)"
|
||||
d="M121.272 233.143C107.829 233.143 96.5983 222.277 98.2527 208.935C100.041 194.517 103.743 182.243 109.359 172.114C118.044 156.724 129.321 145.524 143.187 138.514C157.206 131.505 171.987 128 187.53 128C203.073 128 217.168 131.505 229.816 138.514C242.616 145.371 257.473 155.886 274.387 170.057C285.816 179.657 294.806 186.514 301.359 190.629C308.063 194.59 315.53 196.571 323.759 196.571C337.016 196.571 347.454 191.848 355.073 182.4C358.706 177.895 361.421 172.385 363.218 165.87C366.904 152.504 377.243 140.8 391.107 140.8V140.8C404.499 140.8 415.745 151.539 414.202 164.842C412.521 179.332 408.811 191.661 403.073 201.829C394.387 217.219 383.035 228.419 369.016 235.429C354.997 242.438 340.216 245.943 324.673 245.943C309.13 245.943 294.959 242.667 282.159 236.114C269.359 229.41 254.578 218.667 237.816 203.886C226.844 194.286 217.93 187.505 211.073 183.543C204.216 179.429 196.673 177.371 188.444 177.371C176.101 177.371 165.892 181.638 157.816 190.171C153.612 194.613 150.564 200.623 148.673 208.202C145.336 221.569 135.05 233.143 121.272 233.143V233.143ZM121.272 371.2C107.829 371.2 96.5983 360.334 98.2527 346.993C100.041 332.574 103.743 320.3 109.359 310.171C118.044 294.781 129.321 283.581 143.187 276.571C157.206 269.562 171.987 266.057 187.53 266.057C203.073 266.057 217.168 269.562 229.816 276.571C242.616 283.429 257.473 293.943 274.387 308.114C285.816 317.714 294.806 324.571 301.359 328.686C308.063 332.648 315.53 334.629 323.759 334.629C337.016 334.629 347.454 329.905 355.073 320.457C358.706 315.952 361.421 310.442 363.218 303.927C366.904 290.561 377.243 278.857 391.107 278.857V278.857C404.499 278.857 415.745 289.597 414.202 302.899C412.521 317.389 408.811 329.718 403.073 339.886C394.387 355.276 383.035 366.476 369.016 373.486C354.997 380.495 340.216 384 324.673 384C309.13 384 294.959 380.724 282.159 374.171C269.359 367.467 254.578 356.724 237.816 341.943C226.844 332.343 217.93 325.562 211.073 321.6C204.216 317.486 196.673 315.429 188.444 315.429C176.101 315.429 165.892 319.695 157.816 328.229C153.612 332.67 150.564 338.68 148.673 346.259C145.336 359.626 135.05 371.2 121.272 371.2V371.2Z"
|
||||
data-flx="ui.icons.fluxer-icon.path"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
return <FluxerIconMark aria-label={ariaLabel} data-flx="ui.icons.fluxer-icon.img" {...props} />;
|
||||
});
|
||||
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {msg} from '@lingui/core/macro';
|
||||
import type React from 'react';
|
||||
|
||||
export const APPLICATION_ICON_DESCRIPTOR = msg({
|
||||
message: '{productName} application icon',
|
||||
comment: 'Accessible label for the Fluxer application icon.',
|
||||
});
|
||||
|
||||
export const FluxerIconMark = (props: React.SVGProps<SVGSVGElement>) => (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 512 512"
|
||||
role="img"
|
||||
data-flx="ui.icons.fluxer-icon.img"
|
||||
{...props}
|
||||
>
|
||||
<rect fill="var(--brand-primary)" height={512} rx={256} width={512} data-flx="ui.icons.fluxer-icon.rect" />
|
||||
<path
|
||||
fill="var(--brand-primary-fill)"
|
||||
d="M121.272 233.143C107.829 233.143 96.5983 222.277 98.2527 208.935C100.041 194.517 103.743 182.243 109.359 172.114C118.044 156.724 129.321 145.524 143.187 138.514C157.206 131.505 171.987 128 187.53 128C203.073 128 217.168 131.505 229.816 138.514C242.616 145.371 257.473 155.886 274.387 170.057C285.816 179.657 294.806 186.514 301.359 190.629C308.063 194.59 315.53 196.571 323.759 196.571C337.016 196.571 347.454 191.848 355.073 182.4C358.706 177.895 361.421 172.385 363.218 165.87C366.904 152.504 377.243 140.8 391.107 140.8V140.8C404.499 140.8 415.745 151.539 414.202 164.842C412.521 179.332 408.811 191.661 403.073 201.829C394.387 217.219 383.035 228.419 369.016 235.429C354.997 242.438 340.216 245.943 324.673 245.943C309.13 245.943 294.959 242.667 282.159 236.114C269.359 229.41 254.578 218.667 237.816 203.886C226.844 194.286 217.93 187.505 211.073 183.543C204.216 179.429 196.673 177.371 188.444 177.371C176.101 177.371 165.892 181.638 157.816 190.171C153.612 194.613 150.564 200.623 148.673 208.202C145.336 221.569 135.05 233.143 121.272 233.143V233.143ZM121.272 371.2C107.829 371.2 96.5983 360.334 98.2527 346.993C100.041 332.574 103.743 320.3 109.359 310.171C118.044 294.781 129.321 283.581 143.187 276.571C157.206 269.562 171.987 266.057 187.53 266.057C203.073 266.057 217.168 269.562 229.816 276.571C242.616 283.429 257.473 293.943 274.387 308.114C285.816 317.714 294.806 324.571 301.359 328.686C308.063 332.648 315.53 334.629 323.759 334.629C337.016 334.629 347.454 329.905 355.073 320.457C358.706 315.952 361.421 310.442 363.218 303.927C366.904 290.561 377.243 278.857 391.107 278.857V278.857C404.499 278.857 415.745 289.597 414.202 302.899C412.521 317.389 408.811 329.718 403.073 339.886C394.387 355.276 383.035 366.476 369.016 373.486C354.997 380.495 340.216 384 324.673 384C309.13 384 294.959 380.724 282.159 374.171C269.359 367.467 254.578 356.724 237.816 341.943C226.844 332.343 217.93 325.562 211.073 321.6C204.216 317.486 196.673 315.429 188.444 315.429C176.101 315.429 165.892 319.695 157.816 328.229C153.612 332.67 150.564 338.68 148.673 346.259C145.336 359.626 135.05 371.2 121.272 371.2V371.2Z"
|
||||
data-flx="ui.icons.fluxer-icon.path"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import type {ElectronAPI} from '@app/types/electron.d';
|
||||
|
||||
export function isElectron(): boolean {
|
||||
if (typeof window === 'undefined') return false;
|
||||
return (
|
||||
(
|
||||
window as {
|
||||
electron?: ElectronAPI;
|
||||
}
|
||||
).electron !== undefined
|
||||
);
|
||||
}
|
||||
|
||||
export function hasUnavailableElectronNativeContext(): boolean {
|
||||
if (typeof window === 'undefined' || typeof navigator === 'undefined') return false;
|
||||
return (
|
||||
(
|
||||
window as {
|
||||
electron?: ElectronAPI | null;
|
||||
}
|
||||
).electron == null && /\bElectron\/\d+(?:\.\d+)*/.test(navigator.userAgent)
|
||||
);
|
||||
}
|
||||
@@ -1,33 +1,14 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {Logger} from '@app/features/platform/utils/AppLogger';
|
||||
import {isElectron} from '@app/features/ui/utils/ElectronRuntime';
|
||||
import type {ElectronAPI} from '@app/types/electron.d';
|
||||
import Bowser from 'bowser';
|
||||
|
||||
export {hasUnavailableElectronNativeContext, isElectron} from '@app/features/ui/utils/ElectronRuntime';
|
||||
|
||||
const logger = new Logger('NativeUtils');
|
||||
|
||||
export function isElectron(): boolean {
|
||||
if (typeof window === 'undefined') return false;
|
||||
return (
|
||||
(
|
||||
window as {
|
||||
electron?: ElectronAPI;
|
||||
}
|
||||
).electron !== undefined
|
||||
);
|
||||
}
|
||||
|
||||
export function hasUnavailableElectronNativeContext(): boolean {
|
||||
if (typeof window === 'undefined' || typeof navigator === 'undefined') return false;
|
||||
return (
|
||||
(
|
||||
window as {
|
||||
electron?: ElectronAPI | null;
|
||||
}
|
||||
).electron == null && /\bElectron\/\d+(?:\.\d+)*/.test(navigator.userAgent)
|
||||
);
|
||||
}
|
||||
|
||||
export function getElectronAPI(): ElectronAPI | null {
|
||||
if (!isElectron()) return null;
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user