Compare commits

...

11 Commits

Author SHA1 Message Date
Viktor Rådberg
4453b12ce6 bump 2024-01-13 20:32:10 +01:00
Viktor Rådberg
d601a820f8 remove log 2024-01-13 20:32:00 +01:00
Viktor Rådberg
0455f43794 test 2024-01-13 20:26:07 +01:00
Viktor Rådberg
f94103fe51 fix 2024-01-13 20:20:50 +01:00
Viktor Rådberg
c36668b933 fix 2024-01-13 20:20:20 +01:00
Viktor Rådberg
f9d0346300 bump 2024-01-13 20:18:50 +01:00
Viktor Rådberg
2f3ee74c74 test 2024-01-13 20:15:43 +01:00
Viktor Rådberg
f8f0788b97 bump 2024-01-13 19:53:02 +01:00
Viktor Rådberg
bfe25eacb7 fix lint 2024-01-13 19:44:27 +01:00
Viktor Rådberg
7b0965c0dd test release 2024-01-13 19:40:36 +01:00
Viktor Rådberg
e55ea6a83a final test 2024-01-13 19:32:16 +01:00
3 changed files with 33 additions and 31 deletions

View File

@@ -4,32 +4,32 @@ name: Deploy to Firebase Hosting
tags: tags:
- '*' - '*'
jobs: jobs:
# build_and_deploy: build_and_deploy:
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# env: env:
# REPO_READ_ACCESS_TOKEN: ${{ secrets.REPO_READ_ACCESS_TOKEN }} REPO_READ_ACCESS_TOKEN: ${{ secrets.REPO_READ_ACCESS_TOKEN }}
# steps: steps:
# - name: Checkout repository - name: Checkout repository
# uses: actions/checkout@v3 uses: actions/checkout@v3
# - name: Setup bun - name: Setup bun
# uses: oven-sh/setup-bun@v1 uses: oven-sh/setup-bun@v1
# - name: Build, lint, and deploy - name: Build, lint, and deploy
# run: | run: |
# bun install bun install
# bun run build bun run build
# bun run lint bun run lint
# - name: Deploy to Firebase Hosting - name: Deploy to Firebase Hosting
# uses: FirebaseExtended/action-hosting-deploy@v0 uses: FirebaseExtended/action-hosting-deploy@v0
# with: with:
# repoToken: '${{ secrets.GITHUB_TOKEN }}' repoToken: '${{ secrets.GITHUB_TOKEN }}'
# firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_LIFE_TRINKET }}' firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_LIFE_TRINKET }}'
# channelId: live channelId: live
# projectId: life-trinket projectId: life-trinket
release: release:
# needs: build_and_deploy needs: build_and_deploy
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
@@ -52,7 +52,7 @@ jobs:
- name: Create Release - name: Create Release
uses: ncipollo/release-action@v1.13.0 uses: ncipollo/release-action@v1.13.0
with: with:
body: release_note.txt bodyFile: release_note.txt
commit: ${{ github.sha }} commit: ${{ github.sha }}
tag: '${{ steps.version.outputs.prop }}' tag: '${{ steps.version.outputs.prop }}'
token: ${{ secrets.RELEASE_TOKEN }} token: ${{ secrets.RELEASE_TOKEN }}

View File

@@ -1,7 +1,7 @@
{ {
"name": "life-trinket", "name": "life-trinket",
"private": true, "private": true,
"version": "0.5.3", "version": "0.5.45",
"type": "commonjs", "type": "commonjs",
"engines": { "engines": {
"node": ">=18", "node": ">=18",

View File

@@ -4,7 +4,7 @@ import { useGlobalSettings } from '../../Hooks/useGlobalSettings';
import { ModalWrapper } from './InfoModal'; import { ModalWrapper } from './InfoModal';
import { Separator } from './Separator'; import { Separator } from './Separator';
import { Paragraph } from './TextComponents'; import { Paragraph } from './TextComponents';
import { useEffect, useRef, useState } from 'react'; import { useEffect, useState } from 'react';
const SettingContainer = twc.div`w-full flex flex-col`; const SettingContainer = twc.div`w-full flex flex-col`;
@@ -22,7 +22,7 @@ type SettingsModalProps = {
export const SettingsModal = ({ isOpen, closeModal }: SettingsModalProps) => { export const SettingsModal = ({ isOpen, closeModal }: SettingsModalProps) => {
const { settings, setSettings, isPWA } = useGlobalSettings(); const { settings, setSettings, isPWA } = useGlobalSettings();
const [isLatestVersion, setIsLatestVersion] = useState(false); const [isLatestVersion, setIsLatestVersion] = useState(false);
const newVersion = useRef<string | undefined>(undefined); const [newVersion, setNewVersion] = useState<string | undefined>(undefined);
useEffect(() => { useEffect(() => {
if (!isOpen) { if (!isOpen) {
@@ -44,17 +44,19 @@ export const SettingsModal = ({ isOpen, closeModal }: SettingsModalProps) => {
const data = await result.json(); const data = await result.json();
if (!data.name) { if (!data.name) {
setNewVersion(undefined);
setIsLatestVersion(false); setIsLatestVersion(false);
newVersion.current = undefined;
return; return;
} }
setNewVersion(data.name);
/* @ts-expect-error is defined in vite.config.ts*/ /* @ts-expect-error is defined in vite.config.ts*/
if (data.name === APP_VERSION) { if (data.name === APP_VERSION) {
newVersion.current = data.name;
setIsLatestVersion(true); setIsLatestVersion(true);
return; return;
} }
setIsLatestVersion(false); setIsLatestVersion(false);
} catch (error) { } catch (error) {
console.error('error getting latest version string', error); console.error('error getting latest version string', error);
@@ -147,13 +149,13 @@ export const SettingsModal = ({ isOpen, closeModal }: SettingsModalProps) => {
<span className="text-sm text-text-secondary">(latest)</span> <span className="text-sm text-text-secondary">(latest)</span>
)} )}
</Paragraph> </Paragraph>
{!isLatestVersion && newVersion.current && ( {!isLatestVersion && newVersion && (
<Paragraph className="text-text-secondary text-lg text-center"> <Paragraph className="text-text-secondary text-lg text-center">
New version ({newVersion.current}) is available!{' '} New version ({newVersion}) is available!{' '}
</Paragraph> </Paragraph>
)} )}
</SettingContainer> </SettingContainer>
{!isLatestVersion && newVersion.current && ( {!isLatestVersion && newVersion && (
<Button <Button
variant="contained" variant="contained"
style={{ marginTop: '0.25rem', marginBottom: '0.25rem' }} style={{ marginTop: '0.25rem', marginBottom: '0.25rem' }}