mirror of
https://github.com/Kvan7/Exiled-Exchange-2.git
synced 2026-10-09 21:01:30 +00:00
fix poedb links having new format
This commit is contained in:
1 parent
bc4e1d0e7a
commit
6e73f2feef
1 file changed
+9
-3
@@ -1,8 +1,13 @@
|
||||
import { Host } from '@/web/background/IPC'
|
||||
import { AppConfig } from '@/web/Config'
|
||||
import { AppConfig, Config } from '@/web/Config'
|
||||
import { ParsedItem, parseClipboard } from '@/parser'
|
||||
|
||||
const POEDB_LANGS = { 'en': 'us', 'ru': 'ru', 'cmn-Hant': 'tw', 'ko': 'kr' }
|
||||
const POEDB_LANGS: Record<Config['language'], string> = {
|
||||
'en': 'us',
|
||||
'ru': 'ru',
|
||||
'cmn-Hant': 'tw',
|
||||
'ko': 'kr'
|
||||
}
|
||||
|
||||
export function registerActions () {
|
||||
Host.onEvent('MAIN->CLIENT::item-text', (e) => {
|
||||
@@ -26,7 +31,8 @@ export function openWiki (item: ParsedItem) {
|
||||
window.open(`https://www.poewiki.net/wiki/${item.info.refName}`)
|
||||
}
|
||||
export function openPoedb (item: ParsedItem) {
|
||||
window.open(`https://poedb.tw/${POEDB_LANGS[AppConfig().language]}/search?q=${item.info.refName}`)
|
||||
const slug = encodeURIComponent(item.info.refName.replaceAll("'", '').replaceAll(' ', '_'))
|
||||
window.open(`https://poedb.tw/${POEDB_LANGS[AppConfig().language]}/${slug}`)
|
||||
}
|
||||
export function openCoE (item: ParsedItem) {
|
||||
const encodedClipboard = encodeURIComponent(item.rawText)
|
||||
|
||||
Reference in new issue
Block a user