Fix linting issues
continuous-integration/drone/pr Build is failing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Hamcha 2019-09-20 15:13:15 +02:00
parent c9312b1c9f
commit 952e29edf1
Signed by: hamcha
GPG Key ID: 44AD3571EB09A39E
5 changed files with 15 additions and 17 deletions

View File

@ -18,9 +18,7 @@ module.exports = {
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)'
],
files: ["**/__tests__/*.{j,t}s?(x)"],
env: {
jest: true
}

View File

@ -2,8 +2,7 @@
<img :src="imageURL" />
</template>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>
<script lang="ts">
import { Component, Vue, Prop } from "vue-property-decorator";

View File

@ -57,7 +57,7 @@ export class Session extends EventEmitter {
// Place players in the pod
switch (this.options.spacing) {
case "evenly":
case "evenly": {
const playerRatio = spots / playerNum;
let i = 0;
for (const player of players) {
@ -67,16 +67,15 @@ export class Session extends EventEmitter {
i += 1;
}
break;
}
case "randomly":
for (const player of players) {
while (true) {
const idx = Math.floor(Math.random() * spots);
if (this.pod[idx].name == "") {
this.pod[idx].name = player;
assignFn(name, this.pod[idx]);
break;
}
}
const free = [...Array(spots).keys()].filter(
i => this.pod[i].name == ""
);
const idx = Math.floor(Math.random() * free.length);
const chosen = free[idx];
assignFn(player, this.pod[chosen]);
}
break;
}
@ -179,10 +178,11 @@ export class Session extends EventEmitter {
const provider = DraftProvider.set(factory, options.packs);
return new Session(options, provider);
}
case "i8pcube":
case "i8pcube": {
const cube = await I8PCube.fromURL(options.url);
const provider = new DraftProvider(cube.schema());
return new Session(options, provider);
}
default:
throw new Error("Unknown draft source");
}

View File

@ -12,12 +12,13 @@ export async function cardImageURL(cardid: string): Promise<string> {
return remoteImageURL(cardid);
}
switch (cardImageSource()) {
case "local":
case "local": {
const card = await Database.images.get(`${cardid}.webp`);
if (!card) {
return remoteImageURL(cardid);
}
return URL.createObjectURL(card.image);
}
//TODO
case "remote":
return remoteImageURL(cardid);

View File

@ -2,4 +2,4 @@ module.exports = {
env: {
jest: true
}
}
};