don't assume the variables will be filled
This commit is contained in:
parent
6e2bb0ddab
commit
0544b91872
@ -11,3 +11,5 @@ node_modules
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
Taskfile.yaml
|
||||
.eslintignore
|
||||
|
@ -19,7 +19,7 @@ tasks:
|
||||
lint:fix:
|
||||
cmds:
|
||||
- npx prettier --write {{.CLI_ARGS | default .FILES }}
|
||||
# - npx eslint --fix --quiet {{.CLI_ARGS | default .FILES }}
|
||||
- npx eslint --fix --quiet {{.CLI_ARGS | default .FILES }}
|
||||
integrate:
|
||||
cmds:
|
||||
- git is-clean
|
||||
|
@ -15,6 +15,7 @@
|
||||
const api = genApi();
|
||||
|
||||
setContext('api', api);
|
||||
console.log('api set, sucka');
|
||||
|
||||
const routes = {
|
||||
// Exact path
|
||||
|
@ -86,10 +86,10 @@
|
||||
<i>arrow_backward</i>
|
||||
</button>
|
||||
</a>
|
||||
{#if $activeCampaign.battles.length > battle.id}
|
||||
{#if battles?.length > battle?.id}
|
||||
<a
|
||||
href={`#/campaign/${$activeCampaign._id}/battle/${
|
||||
battle.id + 1
|
||||
href={`#/campaign/${$activeCampaign?._id}/battle/${
|
||||
battle?.id + 1
|
||||
}`}
|
||||
>
|
||||
<button class="circle transparent">
|
||||
@ -113,7 +113,7 @@
|
||||
|
||||
event?.setActiveCampaign(params.campaignId);
|
||||
|
||||
$: battles = $activeCampaign?.battles;
|
||||
$: battles = $activeCampaign?.battles ?? [];
|
||||
$: battle = battles && battles[params.battleId - 1];
|
||||
$: scenario = battle?.scenario;
|
||||
$: status = battle?.status;
|
||||
@ -122,10 +122,8 @@
|
||||
$: character = battle?.character;
|
||||
$: city = battle?.city;
|
||||
|
||||
$: console.log(battle);
|
||||
|
||||
let chapter = 1 + parseInt(params.battleId / 2);
|
||||
let chapterBattle =
|
||||
$: chapterBattle =
|
||||
params.battleId >= 7
|
||||
? params.battleId - 6
|
||||
: 1 + ((params.battleId - 1) % 2);
|
||||
|
Loading…
Reference in New Issue
Block a user