From 1df95e10f49ba64ab82fc602e4d651c62f6b86fb Mon Sep 17 00:00:00 2001 From: Spythere Date: Sun, 16 Aug 2020 20:56:34 +0200 Subject: [PATCH] =?UTF-8?q?Hotfix:=20z=C5=82e=20przekierowanie=20ze=20?= =?UTF-8?q?=C5=9Bcie=C5=BCki=20/trains=20do=20404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- firebase.json | 10 ++++++---- functions/src/index.ts | 8 +++++--- vue.config.js | 3 +++ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 vue.config.js diff --git a/firebase.json b/firebase.json index 8b1617d..a0ce57e 100644 --- a/firebase.json +++ b/firebase.json @@ -2,10 +2,12 @@ "hosting": { "public": "dist", "site": "stacjownik-td2", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" + "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], + "rewrites": [ + { + "source": "**", + "destination": "/index.html" + } ] }, "functions": { diff --git a/functions/src/index.ts b/functions/src/index.ts index cc2e03d..ce0c061 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -12,6 +12,8 @@ exports.scheduledUpdate = functions.pubsub let stationData: { stationName: string; dispatcherName: string; + isOnline: boolean; + region: string; }[]; try { @@ -52,9 +54,9 @@ exports.scheduledUpdate = functions.pubsub const docData = doc.data(); const docRef = historyRef.doc(doc.id); - const APIStationData = stationData.find( - (station) => station.stationName == doc.id - ); + const APIStationData = stationData + .filter((station) => station.isOnline && station.region === "eu") + .find((station) => station.stationName == doc.id); if (docData.currentDispatcherName != "") { if ( diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..3d0f6ad --- /dev/null +++ b/vue.config.js @@ -0,0 +1,3 @@ +module.exports = { + publicPath: process.env.NODE_ENV === "production" ? "/dist" : "/", +};