1
0
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:
Ondřej Synáček
2020-12-15 20:40:01 +01:00
parent a89777b91a
commit 61985990d0
3 changed files with 2 additions and 36 deletions

View File

@@ -1,5 +1,3 @@
import { useStorage } from './utils'
const migrateRecord = (record) => {
// NOTE: v3 records
const id = record.id || record.order
@@ -13,10 +11,6 @@ const migrateRecord = (record) => {
}
const getStorage = () => {
if (!useStorage()) {
return null
}
const storage = localStorage.getItem('fb-to-ical-events')
if (!storage) {
@@ -28,10 +22,6 @@ const getStorage = () => {
}
const getConfigStorage = () => {
if (!useStorage()) {
return null
}
const storage = localStorage.getItem('fb-to-ical-config')
if (!storage) {
@@ -62,10 +52,6 @@ const updateConfigStorage = (storageContents, key, value) => {
}
const saveRecord = ({ id, link, createdAt, startTime, title }) => {
if (!useStorage()) {
return
}
const storage = getStorage()
const storageContents = getStorageContents(storage)
@@ -81,10 +67,6 @@ const saveRecord = ({ id, link, createdAt, startTime, title }) => {
}
const deleteRecord = (id) => {
if (!useStorage()) {
return
}
const storage = getStorage()
const storageContents = getStorageContents(storage)
const index = storageContents.findIndex((record) => {