style(Update to 2): Update branding

Renamed to Exalted PoE2 Trade
This commit is contained in:
kvan7
2024-12-10 15:47:06 -06:00
committed by Kvan7
parent c3d6c69d9d
commit fd4917ca7f
22 changed files with 414 additions and 275 deletions

View File

@@ -8,7 +8,7 @@ import { useData } from 'vitepress'
const { theme } = useData() const { theme } = useData()
</script> </script>
You can download Awakened Poe Trade here. Any other mirrors are not known You can download Exalted Poe Trade here. Any other mirrors are not known
to the developer, downloading from them may be unsafe. to the developer, downloading from them may be unsafe.
| Download link | Automatic updates | Startup time | | Download link | Automatic updates | Startup time |

View File

@@ -0,0 +1,33 @@
{
"folders": [
{
"name": "renderer",
"path": "renderer"
},
{
"name": "main",
"path": "main"
},
{
"name": "docs",
"path": "docs"
},
{
"name": "root",
"path": "."
}
],
"settings": {
"files.exclude": {
"main/": true,
"renderer/": true,
"docs/": true,
"dist/": true
},
"editor.tabSize": 2,
"editor.insertSpaces": true,
"conventionalCommits.scopes": [
"Update to 2"
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 KiB

After

Width:  |  Height:  |  Size: 712 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 66 KiB

BIN
main/build/icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -10,7 +10,7 @@
"fix": "eslint src --fix" "fix": "eslint src --fix"
}, },
"author": { "author": {
"name": "Alexander Drozdov" "name": "Garrett Parker"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@@ -6394,4 +6394,4 @@
} }
} }
} }
} }

View File

@@ -1,63 +1,63 @@
{ {
"name": "exiled-exchange-2-2", "name": "exiled-exchange-2-2",
"version": "0.0.0", "version": "0.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"lint": "eslint --ext .ts,.vue src", "lint": "eslint --ext .ts,.vue src",
"lint-fix": "eslint --ext .ts,.vue src --fix", "lint-fix": "eslint --ext .ts,.vue src --fix",
"build": "vue-tsc --noEmit && vite build", "build": "vue-tsc --noEmit && vite build",
"make-index-files": "node src/assets/make-index-files.mjs" "make-index-files": "node src/assets/make-index-files.mjs"
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "6.x.x", "@fortawesome/fontawesome-free": "6.x.x",
"@sindresorhus/fnv1a": "^3.0.0", "@sindresorhus/fnv1a": "^3.0.0",
"@vueuse/core": "^11.0.0", "@vueuse/core": "^11.0.0",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"apexcharts": "^4.0.0", "apexcharts": "^4.0.0",
"dot-prop": "9.x.x", "dot-prop": "9.x.x",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"fastest-levenshtein": "^1.0.16", "fastest-levenshtein": "^1.0.16",
"luxon": "3.x.x", "luxon": "3.x.x",
"neverthrow": "^8.0.0", "neverthrow": "^8.0.0",
"object-hash": "^3.0.0", "object-hash": "^3.0.0",
"sockette": "^2.0.6", "sockette": "^2.0.6",
"tailwindcss": "3.x.x", "tailwindcss": "3.x.x",
"tippy.js": "^6.2.7", "tippy.js": "^6.2.7",
"vue": "3.2.37", "vue": "3.2.37",
"vue-i18n": "^10.0.0", "vue-i18n": "^10.0.0",
"vue3-apexcharts": "^1.1.1", "vue3-apexcharts": "^1.1.1",
"vuedraggable": "4.1.0" "vuedraggable": "4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@types/luxon": "^3.0.0", "@types/luxon": "^3.0.0",
"@types/node": "^20.0.0", "@types/node": "^20.0.0",
"@types/object-hash": "^3.0.0", "@types/object-hash": "^3.0.0",
"@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue": "^4.0.0",
"autoprefixer": "^10.0.2", "autoprefixer": "^10.0.2",
"postcss": "^8.2.14", "postcss": "^8.2.14",
"typescript": "5.6.x", "typescript": "5.6.x",
"vite": "^5.0.0", "vite": "^5.0.0",
"vue-tsc": "^2.0.0" "vue-tsc": "^2.0.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0", "@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.21.0", "eslint": "^8.21.0",
"eslint-config-standard-with-typescript": "^31.0.0", "eslint-config-standard-with-typescript": "^31.0.0",
"eslint-plugin-import": "^2.20.2", "eslint-plugin-import": "^2.20.2",
"eslint-plugin-n": "^15.0.0", "eslint-plugin-n": "^15.0.0",
"eslint-plugin-promise": "^6.0.0", "eslint-plugin-promise": "^6.0.0",
"eslint-plugin-vue": "^9.1.1" "eslint-plugin-vue": "^9.1.1"
}, },
"postcss": { "postcss": {
"plugins": { "plugins": {
"tailwindcss/nesting": {}, "tailwindcss/nesting": {},
"tailwindcss": {}, "tailwindcss": {},
"autoprefixer": {} "autoprefixer": {}
} }
}, },
"browserslist": [ "browserslist": [
"chrome >= 101" "chrome >= 101"
] ]
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -13,51 +13,53 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { shallowRef } from 'vue' import { shallowRef } from 'vue';
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n';
import { Host } from '@/web/background/IPC' import { Host } from '@/web/background/IPC';
import { AppConfig } from '@/web/Config' import { AppConfig } from '@/web/Config';
const { t } = useI18n() const { t } = useI18n();
const show = shallowRef(false) const show = shallowRef(false);
Host.onEvent('MAIN->OVERLAY::overlay-attached', () => { Host.onEvent('MAIN->OVERLAY::overlay-attached', () => {
if (!show.value && AppConfig().showAttachNotification) { if (!show.value && AppConfig().showAttachNotification) {
show.value = true show.value = true;
setTimeout(() => { show.value = false }, 2500) setTimeout(() => {
} show.value = false;
}) }, 2500);
}
});
</script> </script>
<style lang="postcss" module> <style lang="postcss" module>
.widget { .widget {
position: absolute; position: absolute;
display: flex; display: flex;
width: 100%; width: 100%;
justify-content: center; justify-content: center;
bottom: 20%; bottom: 20%;
} }
.box { .box {
position: relative; position: relative;
display: flex; display: flex;
@apply bg-gray-800; @apply bg-gray-800;
@apply text-gray-100; @apply text-gray-100;
@apply rounded; @apply rounded;
box-shadow: 0px 0px 1px 2px rgb(255 255 255 / 20%); box-shadow: 0px 0px 1px 2px rgb(255 255 255 / 20%);
} }
.box::before { .box::before {
position: absolute; position: absolute;
content: ''; content: '';
background: url('/images/TransferOrb.png') no-repeat top right/contain; background: url('/images/exa.png') no-repeat top right/contain;
right: 100%; right: 100%;
width: 100%; width: 100%;
height: 100%; height: 100%;
max-width: 78px; max-width: 78px;
@apply mr-2; @apply mr-2;
pointer-events: none; pointer-events: none;
filter: drop-shadow(2px 4px 6px #000); filter: drop-shadow(2px 4px 6px #000);
} }
</style> </style>

View File

@@ -1,62 +1,119 @@
<template> <template>
<div style="top: 0; left: 0; height: 100%; width: 100%; position: absolute;" <div
class="flex grow h-full pointer-events-none" :class="{ style="top: 0; left: 0; height: 100%; width: 100%; position: absolute"
'flex-row': clickPosition === 'stash', class="flex grow h-full pointer-events-none"
'flex-row-reverse': clickPosition === 'inventory', :class="{
}"> 'flex-row': clickPosition === 'stash',
<div v-if="!isBrowserShown" class="layout-column shrink-0" style="width: var(--game-panel);"> 'flex-row-reverse': clickPosition === 'inventory',
</div> }"
<div id="price-window" class="layout-column shrink-0 text-gray-200 pointer-events-auto" style="width: 28.75rem;"> >
<ConversionWarningBanner /> <div
<AppTitleBar @close="closePriceCheck" @click="openLeagueSelection" :title="title"> v-if="!isBrowserShown"
<ui-popover v-if="stableOrbCost" trigger="click" boundary="#price-window"> class="layout-column shrink-0"
<template #target> style="width: var(--game-panel)"
<button><i class="fas fa-exchange-alt" /> {{ stableOrbCost }}</button> ></div>
</template> <div
<template #content> id="price-window"
<item-quick-price class="text-base" :price="{ min: stableOrbCost, max: stableOrbCost, currency: 'chaos' }" class="layout-column shrink-0 text-gray-200 pointer-events-auto"
item-img="/images/divine.png" /> style="width: 28.75rem"
<div v-for="i in 9" :key="i"> >
<div class="pl-1">{{ i / 10 }} div {{ Math.round(stableOrbCost * i / 10) }} c</div> <ConversionWarningBanner />
</div> <AppTitleBar
</template> @close="closePriceCheck"
</ui-popover> @click="openLeagueSelection"
<i v-else-if="xchgRateLoading()" class="fas fa-dna fa-spin px-2" /> :title="title"
<div v-else class="w-8" /> >
</AppTitleBar> <ui-popover
<div class="grow layout-column min-h-0 bg-gray-800"> v-if="stableOrbCost"
<background-info /> trigger="click"
<check-position-circle v-if="showCheckPos" :position="checkPosition" style="z-index: -1;" /> boundary="#price-window"
<template v-if="item?.isErr()"> >
<ui-error-box class="m-4"> <template #target>
<template #name>{{ t(item.error.name) }}</template> <button>
<p>{{ t(item.error.message) }}</p> <i class="fas fa-exchange-alt" /> {{ stableOrbCost }}
</ui-error-box> </button>
<pre class="bg-gray-900 rounded m-4 overflow-x-hidden p-2">{{ item.error.rawText }}</pre> </template>
</template> <template #content>
<template v-else-if="item?.isOk()"> <item-quick-price
<unidentified-resolver :item="item.value" @identify="handleIdentification($event)" /> class="text-base"
<checked-item v-if="isLeagueSelected" :item="item.value" :advanced-check="advancedCheck" /> :price="{
</template> min: stableOrbCost,
<div v-if="isBrowserShown" class="bg-gray-900 px-6 py-2 truncate"> max: stableOrbCost,
<i18n-t keypath="app.toggle_browser_hint" tag="div"> currency: 'chaos',
<span class="bg-gray-400 text-gray-900 rounded px-1">{{ overlayKey }}</span> }"
</i18n-t> item-img="/images/divine.png"
</div> />
</div> <div v-for="i in 9" :key="i">
</div> <div class="pl-1">
<webview v-if="isBrowserShown" ref="iframeEl" class="pointer-events-auto flex-1" width="100%" height="100%" /> {{ i / 10 }} div {{ Math.round((stableOrbCost * i) / 10) }} c
<div v-else class="layout-column flex-1 min-w-0"> </div>
<div class="flex" :class="{ </div>
'flex-row': clickPosition === 'stash', </template>
'flex-row-reverse': clickPosition === 'inventory' </ui-popover>
}"> <i v-else-if="xchgRateLoading()" class="fas fa-dna fa-spin px-2" />
<related-items v-if="item?.isOk()" class="pointer-events-auto" :item="item.value" <div v-else class="w-8" />
:click-position="clickPosition" /> </AppTitleBar>
<rate-limiter-state class="pointer-events-auto" /> <div class="grow layout-column min-h-0 bg-gray-800">
</div> <background-info />
</div> <check-position-circle
</div> v-if="showCheckPos"
:position="checkPosition"
style="z-index: -1"
/>
<template v-if="item?.isErr()">
<ui-error-box class="m-4">
<template #name>{{ t(item.error.name) }}</template>
<p>{{ t(item.error.message) }}</p>
</ui-error-box>
<pre class="bg-gray-900 rounded m-4 overflow-x-hidden p-2">{{
item.error.rawText
}}</pre>
</template>
<template v-else-if="item?.isOk()">
<unidentified-resolver
:item="item.value"
@identify="handleIdentification($event)"
/>
<checked-item
v-if="isLeagueSelected"
:item="item.value"
:advanced-check="advancedCheck"
/>
</template>
<div v-if="isBrowserShown" class="bg-gray-900 px-6 py-2 truncate">
<i18n-t keypath="app.toggle_browser_hint" tag="div">
<span class="bg-gray-400 text-gray-900 rounded px-1">{{
overlayKey
}}</span>
</i18n-t>
</div>
</div>
</div>
<webview
v-if="isBrowserShown"
ref="iframeEl"
class="pointer-events-auto flex-1"
width="100%"
height="100%"
/>
<div v-else class="layout-column flex-1 min-w-0">
<div
class="flex"
:class="{
'flex-row': clickPosition === 'stash',
'flex-row-reverse': clickPosition === 'inventory',
}"
>
<related-items
v-if="item?.isOk()"
class="pointer-events-auto"
:item="item.value"
:click-position="clickPosition"
/>
<rate-limiter-state class="pointer-events-auto" />
</div>
</div>
</div>
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -81,7 +138,11 @@ import ItemQuickPrice from '@/web/ui/ItemQuickPrice.vue'
import { PriceCheckWidget, WidgetManager } from '../overlay/interfaces' import { PriceCheckWidget, WidgetManager } from '../overlay/interfaces'
import ConversionWarningBanner from '../conversion-warn-banner/ConversionWarningBanner.vue' import ConversionWarningBanner from '../conversion-warn-banner/ConversionWarningBanner.vue'
type ParseError = { name: string; message: string; rawText: ParsedItem['rawText'] } type ParseError = {
name: string;
message: string;
rawText: ParsedItem['rawText'];
};
export default defineComponent({ export default defineComponent({
components: { components: {
@@ -107,75 +168,87 @@ export default defineComponent({
const wm = inject<WidgetManager>('wm')! const wm = inject<WidgetManager>('wm')!
const { xchgRate, initialLoading: xchgRateLoading, queuePricesFetch } = usePoeninja() const { xchgRate, initialLoading: xchgRateLoading, queuePricesFetch } = usePoeninja()
nextTick(() => { nextTick(() => {
props.config.wmWants = 'hide' props.config.wmWants = 'hide';
props.config.wmFlags = ['hide-on-blur', 'skip-menu'] props.config.wmFlags = ['hide-on-blur', 'skip-menu'];
}) });
const item = shallowRef<null | Result<ParsedItem, ParseError>>(null) const item = shallowRef<null | Result<ParsedItem, ParseError>>(null);
const advancedCheck = shallowRef(false) const advancedCheck = shallowRef(false);
const checkPosition = shallowRef({ x: 1, y: 1 }) const checkPosition = shallowRef({ x: 1, y: 1 });
MainProcess.onEvent('MAIN->CLIENT::item-text', (e) => { MainProcess.onEvent('MAIN->CLIENT::item-text', (e) => {
if (e.target !== 'price-check') return if (e.target !== 'price-check') return;
if (Host.isElectron && !e.focusOverlay) { if (Host.isElectron && !e.focusOverlay) {
// everything in CSS pixels // everything in CSS pixels
const width = 28.75 * AppConfig().fontSize const width = 28.75 * AppConfig().fontSize;
const screenX = ((e.position.x - window.screenX) > window.innerWidth / 2) const screenX =
? (window.screenX + window.innerWidth) - wm.poePanelWidth.value - width e.position.x - window.screenX > window.innerWidth / 2
: window.screenX + wm.poePanelWidth.value ? window.screenX +
MainProcess.sendEvent({ window.innerWidth -
name: 'OVERLAY->MAIN::track-area', wm.poePanelWidth.value -
payload: { width
holdKey: props.config.hotkeyHold, : window.screenX + wm.poePanelWidth.value;
closeThreshold: 2.5 * AppConfig().fontSize, MainProcess.sendEvent({
from: e.position, name: 'OVERLAY->MAIN::track-area',
area: { payload: {
x: screenX, holdKey: props.config.hotkeyHold,
y: window.screenY, closeThreshold: 2.5 * AppConfig().fontSize,
width, from: e.position,
height: window.innerHeight area: {
}, x: screenX,
dpr: window.devicePixelRatio y: window.screenY,
} width,
}) height: window.innerHeight,
} },
closeBrowser() dpr: window.devicePixelRatio,
wm.show(props.config.wmId) },
checkPosition.value = e.position });
advancedCheck.value = e.focusOverlay }
closeBrowser();
wm.show(props.config.wmId);
checkPosition.value = e.position;
advancedCheck.value = e.focusOverlay;
item.value = (e.item ? ok(e.item as ParsedItem) : parseClipboard(e.clipboard)) item.value = (
.andThen(item => ( e.item ? ok(e.item as ParsedItem) : parseClipboard(e.clipboard)
(item.category === ItemCategory.HeistContract && item.rarity !== ItemRarity.Unique) || )
(item.category === ItemCategory.Sentinel && item.rarity !== ItemRarity.Unique)) .andThen((item) =>
? err('item.unknown') (item.category === ItemCategory.HeistContract &&
: ok(item)) item.rarity !== ItemRarity.Unique) ||
.mapErr(err => ({ (item.category === ItemCategory.Sentinel &&
name: `${err}`, item.rarity !== ItemRarity.Unique)
message: `${err}_help`, ? err('item.unknown')
rawText: e.clipboard : ok(item)
})) )
.mapErr((err) => ({
name: `${err}`,
message: `${err}_help`,
rawText: e.clipboard,
}));
if (item.value.isOk()) { if (item.value.isOk()) {
queuePricesFetch() queuePricesFetch();
} }
}) });
function handleIdentification (identified: ParsedItem) { function handleIdentification (identified: ParsedItem) {
item.value = ok(identified) item.value = ok(identified)
} }
MainProcess.onEvent('MAIN->OVERLAY::hide-exclusive-widget', () => { MainProcess.onEvent('MAIN->OVERLAY::hide-exclusive-widget', () => {
wm.hide(props.config.wmId) wm.hide(props.config.wmId);
}) });
watch(() => props.config.wmWants, (state) => { watch(
if (state === 'hide') { () => props.config.wmWants,
closeBrowser() (state) => {
} if (state === 'hide') {
}) closeBrowser();
}
}
);
const leagues = useLeagues() const leagues = useLeagues()
const title = computed(() => leagues.selectedId.value || 'Exiled Exchange 2') const title = computed(() => leagues.selectedId.value || 'Exiled Exchange 2')
@@ -195,15 +268,15 @@ export default defineComponent({
} }
}) })
watch(isBrowserShown, (isShown) => { watch(isBrowserShown, (isShown) => {
if (isShown) { if (isShown) {
wm.setFlag(props.config.wmId, 'hide-on-blur', false) wm.setFlag(props.config.wmId, 'hide-on-blur', false);
wm.setFlag(props.config.wmId, 'invisible-on-blur', true) wm.setFlag(props.config.wmId, 'invisible-on-blur', true);
} else { } else {
wm.setFlag(props.config.wmId, 'invisible-on-blur', false) wm.setFlag(props.config.wmId, 'invisible-on-blur', false);
wm.setFlag(props.config.wmId, 'hide-on-blur', true) wm.setFlag(props.config.wmId, 'hide-on-blur', true);
} }
}) });
function closePriceCheck () { function closePriceCheck () {
if (isBrowserShown.value || !Host.isElectron) { if (isBrowserShown.value || !Host.isElectron) {
@@ -219,7 +292,7 @@ export default defineComponent({
wm.show(settings.wmId) wm.show(settings.wmId)
} }
const iframeEl = shallowRef<HTMLIFrameElement | null>(null) const iframeEl = shallowRef<HTMLIFrameElement | null>(null);
function showBrowser (url: string) { function showBrowser (url: string) {
wm.setFlag(props.config.wmId, 'has-browser', true) wm.setFlag(props.config.wmId, 'has-browser', true)
@@ -232,28 +305,28 @@ export default defineComponent({
wm.setFlag(props.config.wmId, 'has-browser', false) wm.setFlag(props.config.wmId, 'has-browser', false)
} }
provide<(url: string) => void>('builtin-browser', showBrowser) provide<(url: string) => void>('builtin-browser', showBrowser);
const { t } = useI18n() const { t } = useI18n();
return { return {
t, t,
clickPosition, clickPosition,
isBrowserShown, isBrowserShown,
iframeEl, iframeEl,
closePriceCheck, closePriceCheck,
title, title,
stableOrbCost, stableOrbCost,
xchgRateLoading, xchgRateLoading,
showCheckPos, showCheckPos,
checkPosition, checkPosition,
item, item,
advancedCheck, advancedCheck,
handleIdentification, handleIdentification,
overlayKey, overlayKey,
isLeagueSelected, isLeagueSelected,
openLeagueSelection openLeagueSelection,
} };
} },
}) });
</script> </script>

View File

@@ -30,10 +30,10 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, computed } from 'vue' import { defineComponent, computed } from 'vue';
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n';
import { Host } from '@/web/background/IPC' import { Host } from '@/web/background/IPC';
import { DateTime } from 'luxon' import { DateTime } from 'luxon';
function checkForUpdates () { function checkForUpdates () {
Host.sendEvent({ Host.sendEvent({
@@ -63,31 +63,62 @@ export default defineComponent({
setup () { setup () {
const { t } = useI18n() const { t } = useI18n()
const info = computed(() => { const info = computed(() => {
const rawInfo = Host.updateInfo.value const rawInfo = Host.updateInfo.value;
switch (rawInfo.state) { switch (rawInfo.state) {
case 'initial': case 'initial':
return { str1: t('updates.maybe_outdated'), str2: t('updates.never_checked'), action: checkForUpdates, actionText: t('updates.check_now') } return {
case 'checking-for-update': str1: t('updates.maybe_outdated'),
return { str1: t('updates.checking'), str2: t('please_wait') } str2: t('updates.never_checked'),
case 'update-not-available': action: checkForUpdates,
return { str1: t('updates.latest'), str2: t('updates.last_checked', [fmtTime(rawInfo.checkedAt)]), action: checkForUpdates, actionText: t('updates.check_now') } actionText: t('updates.check_now'),
case 'error': };
return { str1: t('updates.maybe_outdated'), str2: t('updates.error'), action: openDownloadPage, actionText: t('updates.downloads_page') } case 'checking-for-update':
case 'update-downloaded': return { str1: t('updates.checking'), str2: t('please_wait') };
return { str1: t('updates.available', [rawInfo.version]), str2: t('updates.installed_on_exit'), action: quitAndInstall, actionText: t('updates.install_now') } case 'update-not-available':
case 'update-available': return {
return (rawInfo.noDownloadReason) str1: t('updates.latest'),
? { str1: t('updates.available', [rawInfo.version]), str2: (rawInfo.noDownloadReason === 'not-supported') ? t('updates.download_manually') : t('updates.download_disabled'), action: openDownloadPage, actionText: t('updates.downloads_page') } str2: t('updates.last_checked', [fmtTime(rawInfo.checkedAt)]),
: { str1: t('updates.available', [rawInfo.version]), str2: t('updates.downloading') } action: checkForUpdates,
} actionText: t('updates.check_now'),
}) };
case 'error':
return {
str1: t('updates.maybe_outdated'),
str2: t('updates.error'),
action: openDownloadPage,
actionText: t('updates.downloads_page'),
};
case 'update-downloaded':
return {
str1: t('updates.available', [rawInfo.version]),
str2: t('updates.installed_on_exit'),
action: quitAndInstall,
actionText: t('updates.install_now'),
};
case 'update-available':
return rawInfo.noDownloadReason
? {
str1: t('updates.available', [rawInfo.version]),
str2:
rawInfo.noDownloadReason === 'not-supported'
? t('updates.download_manually')
: t('updates.download_disabled'),
action: openDownloadPage,
actionText: t('updates.downloads_page'),
}
: {
str1: t('updates.available', [rawInfo.version]),
str2: t('updates.downloading'),
};
}
});
return { return {
t, t,
info, info,
version: Host.version version: Host.version,
} };
} },
}) });
</script> </script>