mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix env, sw, pwa
This commit is contained in:
@@ -228,7 +228,7 @@ const AccountSettings = () => {
|
||||
<button onClick={handleImportAccount}>{t('import')}</button> <button onClick={handleExportAccount}>{t('export')}</button>
|
||||
<div className={styles.warning}>
|
||||
{t('stored_locally', {
|
||||
location: window.isElectron ? 'this desktop app' : isAndroid ? 'this mobile app' : window.location.hostname,
|
||||
location: window.electronApi?.isElectron ? 'this desktop app' : isAndroid ? 'this mobile app' : window.location.hostname,
|
||||
interpolation: { escapeValue: false },
|
||||
})}
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@ import { isChristmas } from '../../../lib/utils/time-utils';
|
||||
import Version from '../../version';
|
||||
|
||||
const commitRef = process.env.VITE_COMMIT_REF;
|
||||
const isElectron = window.isElectron === true;
|
||||
const isElectron = window.electronApi?.isElectron === true;
|
||||
|
||||
const CheckForUpdates = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -134,7 +134,7 @@ const PlebbitDataPathSettings = ({ plebbitDataPathRef }: SettingsProps) => {
|
||||
);
|
||||
};
|
||||
|
||||
const isElectron = window.isElectron === true;
|
||||
const isElectron = window.electronApi?.isElectron === true;
|
||||
|
||||
const PlebbitOptions = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -2,12 +2,11 @@ import { useTranslation } from 'react-i18next';
|
||||
import packageJson from '../../../package.json';
|
||||
|
||||
const { version } = packageJson;
|
||||
const commitRef = process.env.VITE_COMMIT_REF;
|
||||
const isElectron = window.isElectron === true;
|
||||
const commitRef = import.meta.env.VITE_COMMIT_REF;
|
||||
const isElectron = window.electronApi?.isElectron === true;
|
||||
|
||||
const Version = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<a
|
||||
@@ -15,7 +14,7 @@ const Version = () => {
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
plebchan v{commitRef ? `${version}-dev (#${commitRef.slice(0, 7)})` : version}
|
||||
v{commitRef ? `${version}#${commitRef.slice(0, 7)}` : version}
|
||||
</a>
|
||||
{isElectron && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user