mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
refactor: remove checks for JS features
Since I'm introducing Svelte framework and targeting modern browsers, I think it does not make sense to check for browser features. I can always choose to use polyfills for backwards compatibility. I will make sure the form is still also rendered via HTML and works for non-SPA use.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { uuidv4, parseStartTimeFromiCalString, useStorage } from './app/utils'
|
||||
import { uuidv4, parseStartTimeFromiCalString } from './app/utils'
|
||||
import {
|
||||
migrateRecord,
|
||||
getStorage,
|
||||
@@ -16,11 +16,6 @@ import generateICS from '../../lib/services/ics-generator'
|
||||
import boot from '../frontend'
|
||||
|
||||
(() => {
|
||||
if (!window.fetch || !window.Promise || !window.URLSearchParams || !window.crypto) {
|
||||
console.warn('JS features not available.')
|
||||
return
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', boot)
|
||||
|
||||
const showTable = () => {
|
||||
@@ -30,10 +25,6 @@ import boot from '../frontend'
|
||||
const deleteTableRow = (id, row) => {
|
||||
deleteRecord(id)
|
||||
|
||||
if (!useStorage()) {
|
||||
return
|
||||
}
|
||||
|
||||
row.remove()
|
||||
}
|
||||
|
||||
@@ -95,10 +86,6 @@ import boot from '../frontend'
|
||||
}
|
||||
|
||||
const hydrateList = () => {
|
||||
if (!useStorage()) {
|
||||
return
|
||||
}
|
||||
|
||||
const prevStorage = getStorage()
|
||||
const migratedStorageContents = getStorageContents(prevStorage).map((record) => {
|
||||
return migrateRecord(record)
|
||||
@@ -129,7 +116,7 @@ import boot from '../frontend'
|
||||
}
|
||||
|
||||
const configureLogger = (logger) => {
|
||||
if (!logger || !useStorage()) {
|
||||
if (!logger) {
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user