-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: ポート変更時に
EngineInfo
の情報を書き換えないようにする。 (#2282)
* refactor: ポート変更時に`EngineInfo`の情報を書き換えないようにする。 * fix: URL組み立て方法の変更とコメント追加 * fix: コメント追加 Co-authored-by: Hiroshiba <hihokaruta@gmail.com> * fix: コメントさらに追記 --------- Co-authored-by: Hiroshiba <hihokaruta@gmail.com>
- Loading branch information
1 parent
a1ace78
commit 755d84b
Showing
12 changed files
with
103 additions
and
55 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 |
---|---|---|
@@ -1,12 +1,19 @@ | ||
import { EngineInfo, envEngineInfoSchema } from "@/type/preload"; | ||
import { type EngineInfo, envEngineInfoSchema } from "@/type/preload"; | ||
|
||
const baseEngineInfo = envEngineInfoSchema | ||
.array() | ||
.parse(JSON.parse(import.meta.env.VITE_DEFAULT_ENGINE_INFOS))[0]; | ||
|
||
export const defaultEngine: EngineInfo = { | ||
...baseEngineInfo, | ||
type: "path", // FIXME: ダミーで"path"にしているので、エンジンAPIのURLを設定できるようにし、type: "URL"にする | ||
isDefault: true, | ||
}; | ||
export const defaultEngine: EngineInfo = (() => { | ||
const { protocol, hostname, port, pathname } = new URL(baseEngineInfo.host); | ||
return { | ||
...baseEngineInfo, | ||
protocol, | ||
hostname, | ||
defaultPort: port, | ||
pathname: pathname === "/" ? "" : pathname, | ||
type: "path", // FIXME: ダミーで"path"にしているので、エンジンAPIのURLを設定できるようにし、type: "URL"にする | ||
isDefault: true, | ||
}; | ||
})(); | ||
export const directoryHandleStoreKey = "directoryHandle"; |
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
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
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