fix logging out should clear input text

This commit is contained in:
Nolan Lawson 2018-03-02 09:10:52 -08:00
parent cd376c5a18
commit 2cb0dc81f5

View file

@ -33,6 +33,7 @@ export async function logOutOfInstance (instanceName) {
let loggedInInstances = store.get('loggedInInstances') let loggedInInstances = store.get('loggedInInstances')
let instanceThemes = store.get('instanceThemes') let instanceThemes = store.get('instanceThemes')
let loggedInInstancesInOrder = store.get('loggedInInstancesInOrder') let loggedInInstancesInOrder = store.get('loggedInInstancesInOrder')
let composeText = store.get('composeText')
let currentInstance = store.get('currentInstance') let currentInstance = store.get('currentInstance')
loggedInInstancesInOrder.splice(loggedInInstancesInOrder.indexOf(instanceName), 1) loggedInInstancesInOrder.splice(loggedInInstancesInOrder.indexOf(instanceName), 1)
let newInstance = instanceName === currentInstance let newInstance = instanceName === currentInstance
@ -40,6 +41,7 @@ export async function logOutOfInstance (instanceName) {
: currentInstance : currentInstance
delete loggedInInstances[instanceName] delete loggedInInstances[instanceName]
delete instanceThemes[instanceName] delete instanceThemes[instanceName]
delete composeText[instanceName]
store.set({ store.set({
loggedInInstances: loggedInInstances, loggedInInstances: loggedInInstances,
instanceThemes: instanceThemes, instanceThemes: instanceThemes,
@ -47,7 +49,8 @@ export async function logOutOfInstance (instanceName) {
currentInstance: newInstance, currentInstance: newInstance,
searchResults: null, searchResults: null,
queryInSearch: '', queryInSearch: '',
rawComposeText: '' rawComposeText: '',
composeText: composeText
}) })
store.save() store.save()
toast.say(`Logged out of ${instanceName}`) toast.say(`Logged out of ${instanceName}`)