forked from pawelmalak/flame
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Case-insensitive sorting. App version checking
- Loading branch information
1 parent
e884c84
commit 9a1ec76
Showing
15 changed files
with
104 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PORT=5005 | ||
NODE_ENV=development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
node_modules/ | ||
data/ | ||
.env | ||
data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
REACT_APP_VERSION=1.3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
client/src/components/Settings/AppDetails/AppDetails.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.AppVersion { | ||
color: var(--color-primary); | ||
margin-bottom: 15px; | ||
} | ||
|
||
.AppVersion a { | ||
color: var(--color-accent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Fragment } from 'react'; | ||
|
||
import classes from './AppDetails.module.css'; | ||
import Button from '../../UI/Buttons/Button/Button'; | ||
import { checkVersion } from '../../../utility'; | ||
|
||
const AppDetails = (): JSX.Element => { | ||
return ( | ||
<Fragment> | ||
<p className={classes.AppVersion}> | ||
<a | ||
href='https://github.com/pawelmalak/flame' | ||
target='_blank' | ||
rel='noreferrer'> | ||
Flame | ||
</a> | ||
{' '} | ||
version {process.env.REACT_APP_VERSION} | ||
</p> | ||
<Button click={() => checkVersion(true)}>Check for updates</Button> | ||
</Fragment> | ||
) | ||
} | ||
|
||
export default AppDetails; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import axios from 'axios'; | ||
import { store } from '../store/store'; | ||
import { createNotification } from '../store/actions'; | ||
|
||
export const checkVersion = async (isForced: boolean = false) => { | ||
try { | ||
const res = await axios.get<string>('https://raw.githubusercontent.com/pawelmalak/flame/master/client/.env'); | ||
|
||
const githubVersion = res.data | ||
.split('\n') | ||
.map(pair => pair.split('='))[0][1]; | ||
|
||
if (githubVersion !== process.env.REACT_APP_VERSION) { | ||
store.dispatch<any>(createNotification({ | ||
title: 'Info', | ||
message: 'New version is available!' | ||
})) | ||
} else if (isForced) { | ||
store.dispatch<any>(createNotification({ | ||
title: 'Info', | ||
message: 'You are using the latest version!' | ||
})) | ||
} | ||
} catch (err) { | ||
console.log(err); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './iconParser'; | ||
export * from './urlParser'; | ||
export * from './searchConfig'; | ||
export * from './searchConfig'; | ||
export * from './checkVersion'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters