Add some text to the version number when Queue is updated.
This commit is contained in:
parent
a651cd1138
commit
93a665dc63
|
@ -65,6 +65,7 @@ browser.runtime.onInstalled.addListener(async () => {
|
||||||
manifest.nodeEnv === 'development'
|
manifest.nodeEnv === 'development'
|
||||||
) {
|
) {
|
||||||
settings.latestVersion = manifest.version;
|
settings.latestVersion = manifest.version;
|
||||||
|
settings.versionGotUpdated = true;
|
||||||
await saveSettings(settings);
|
await saveSettings(settings);
|
||||||
await openOptionsPage();
|
await openOptionsPage();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Queue",
|
"name": "Queue",
|
||||||
"description": "A WebExtension for queueing links.",
|
"description": "A WebExtension for queueing links.",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"contextMenus",
|
"contextMenus",
|
||||||
"storage",
|
"storage",
|
||||||
|
|
|
@ -5,7 +5,8 @@ import {
|
||||||
getSettings,
|
getSettings,
|
||||||
PageFooter,
|
PageFooter,
|
||||||
PageHeader,
|
PageHeader,
|
||||||
PageMain
|
PageMain,
|
||||||
|
saveSettings
|
||||||
} from '.';
|
} from '.';
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
|
@ -14,11 +15,20 @@ import {
|
||||||
const manifest = getManifest();
|
const manifest = getManifest();
|
||||||
const settings = await getSettings();
|
const settings = await getSettings();
|
||||||
|
|
||||||
|
const showVersionUpdated = settings.versionGotUpdated;
|
||||||
|
if (showVersionUpdated) {
|
||||||
|
settings.versionGotUpdated = false;
|
||||||
|
await saveSettings(settings);
|
||||||
|
}
|
||||||
|
|
||||||
render(
|
render(
|
||||||
html`
|
html`
|
||||||
<${PageHeader} />
|
<${PageHeader} />
|
||||||
<${PageMain} settings=${settings} />
|
<${PageMain} settings=${settings} />
|
||||||
<${PageFooter} manifest=${manifest} />
|
<${PageFooter}
|
||||||
|
manifest=${manifest}
|
||||||
|
showVersionUpdated=${showVersionUpdated}
|
||||||
|
/>
|
||||||
`,
|
`,
|
||||||
document.body
|
document.body
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import {html} from 'htm/preact';
|
import {html} from 'htm/preact';
|
||||||
import {Link, QComponent, QManifest} from '../..';
|
import {Link, QComponent, QManifest, Settings} from '../..';
|
||||||
|
|
||||||
type FooterProps = {
|
type FooterProps = {
|
||||||
manifest: QManifest;
|
manifest: QManifest;
|
||||||
|
showVersionUpdated: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function PageFooter(props: FooterProps): QComponent {
|
export function PageFooter(props: FooterProps): QComponent {
|
||||||
|
@ -12,10 +13,13 @@ export function PageFooter(props: FooterProps): QComponent {
|
||||||
url="https://github.com/Holllo/queue/releases/tag/${version}"
|
url="https://github.com/Holllo/queue/releases/tag/${version}"
|
||||||
/>`;
|
/>`;
|
||||||
|
|
||||||
|
const versionUpdated = props.showVersionUpdated ? 'Updated to' : '';
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<footer class="page-footer">
|
<footer class="page-footer">
|
||||||
<p>
|
<p>
|
||||||
${versionLink} 🄯 Holllo — Free and open-source, forever.
|
${versionUpdated} ${versionLink} 🄯 Holllo — Free and open-source,
|
||||||
|
forever.
|
||||||
</p>
|
</p>
|
||||||
</footer>
|
</footer>
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -11,11 +11,13 @@ export type QItem = {
|
||||||
export type Settings = {
|
export type Settings = {
|
||||||
latestVersion: string;
|
latestVersion: string;
|
||||||
queue: QItem[];
|
queue: QItem[];
|
||||||
|
versionGotUpdated: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultSettings: Settings = {
|
const defaultSettings: Settings = {
|
||||||
latestVersion: '0.0.0',
|
latestVersion: '0.0.0',
|
||||||
queue: []
|
queue: [],
|
||||||
|
versionGotUpdated: false
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,7 +35,8 @@ export async function getSettings(): Promise<Settings> {
|
||||||
|
|
||||||
const settings: Settings = {
|
const settings: Settings = {
|
||||||
latestVersion: syncSettings.latestVersion,
|
latestVersion: syncSettings.latestVersion,
|
||||||
queue
|
queue,
|
||||||
|
versionGotUpdated: syncSettings.versionGotUpdated
|
||||||
};
|
};
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
|
|
Loading…
Reference in New Issue