Add ability to export and import followers with settings #121
This commit is contained in:
@ -5,7 +5,8 @@ import {
|
||||
syncUserSettings,
|
||||
setLanguage,
|
||||
themeList,
|
||||
getTheme
|
||||
getTheme,
|
||||
getFollows
|
||||
} from '@/settingsManager'
|
||||
import type { Settings } from '@/settingsManager'
|
||||
|
||||
@ -55,6 +56,8 @@ export default {
|
||||
download() {
|
||||
var hiddenElement = document.createElement('a')
|
||||
|
||||
this.settings.followers = getFollows()
|
||||
|
||||
hiddenElement.href = 'data:attachment/text,' + encodeURI(JSON.stringify(this.settings))
|
||||
hiddenElement.target = '_blank'
|
||||
hiddenElement.download = 'safetwitch_prefs.json'
|
||||
@ -72,6 +75,7 @@ export default {
|
||||
settings = parsed
|
||||
}
|
||||
|
||||
localStorage.setItem('following', JSON.stringify(settings.followers))
|
||||
this.settings = settings
|
||||
this.save()
|
||||
}
|
||||
|
Reference in New Issue
Block a user