Fix build again

This commit is contained in:
BuildTools 2022-07-08 15:27:35 +01:00
parent 9a4c33b289
commit 40d206cb84
7 changed files with 12 additions and 7 deletions

2
src/index.d.ts vendored
View File

@ -170,7 +170,7 @@ interface LiveAtlasProjection {
interface LiveAtlasWorldState { interface LiveAtlasWorldState {
raining: boolean; raining: boolean;
thundering: boolean; thundering: boolean;
timeOfDay: number; timeOfDay?: number;
} }
interface LiveAtlasParsedUrl { interface LiveAtlasParsedUrl {

View File

@ -98,6 +98,10 @@ export class ClockControl extends Control {
const timeOfDay = worldState.timeOfDay; const timeOfDay = worldState.timeOfDay;
let sunAngle; let sunAngle;
if(typeof timeOfDay === 'undefined') {
return;
}
if (timeOfDay > 23100 || timeOfDay < 12900) { if (timeOfDay > 23100 || timeOfDay < 12900) {
//day mode //day mode
let movedTime = timeOfDay + 900; let movedTime = timeOfDay + 900;

View File

@ -53,7 +53,7 @@ export const getters: GetterTree<State, State> & Getters = {
}, },
night(state: State): boolean { night(state: State): boolean {
return getMinecraftTime(state.currentWorldState.timeOfDay).night; return getMinecraftTime(state.currentWorldState.timeOfDay || 0).night;
}, },
mapBackground(state: State): string { mapBackground(state: State): string {
@ -62,7 +62,7 @@ export const getters: GetterTree<State, State> & Getters = {
} }
if(state.currentMap.nightAndDay) { if(state.currentMap.nightAndDay) {
if(getMinecraftTime(state.currentWorldState.timeOfDay).night) { if(getMinecraftTime(state.currentWorldState.timeOfDay || 0).night) {
return state.currentMap.backgroundNight || state.currentMap.background || 'transparent'; return state.currentMap.backgroundNight || state.currentMap.background || 'transparent';
} }

View File

@ -15,7 +15,7 @@
*/ */
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import PlayerImage from '../../src/Components/PlayerImage.vue'; import PlayerImage from '../../src/components/PlayerImage.vue';
import {getDefaultPlayerImage, getPlayerImage} from "@/util/images"; import {getDefaultPlayerImage, getPlayerImage} from "@/util/images";
import {useTestImageProvider} from "../helpers"; import {useTestImageProvider} from "../helpers";

View File

@ -16,7 +16,7 @@
// @vitest-environment jsdom // @vitest-environment jsdom
import {mount, VueWrapper} from '@vue/test-utils'; import {mount, VueWrapper} from '@vue/test-utils';
import Sidebar from '../../src/Components/Sidebar.vue'; import Sidebar from '../../src/components/Sidebar.vue';
import {addDynmapServer, addWorld, clearServers, clearWorlds, enablePlayerMarkers} from "../helpers"; import {addDynmapServer, addWorld, clearServers, clearWorlds, enablePlayerMarkers} from "../helpers";
import {nextTick} from "vue"; import {nextTick} from "vue";
import {useStore} from "@/store"; import {useStore} from "@/store";

View File

@ -15,7 +15,7 @@
*/ */
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import SVGIcon from '../../src/Components/SVGIcon.vue'; import SVGIcon from '../../src/components/SvgIcon.vue';
describe('SVGIcon', async () => { describe('SVGIcon', async () => {
it('exists', () => { it('exists', () => {

View File

@ -16,7 +16,8 @@
"baseUrl": ".", "baseUrl": ".",
"types": [ "types": [
"vite/client", "vite/client",
"vue" "vue",
"vitest/globals"
], ],
"paths": { "paths": {
"@/*": [ "@/*": [