diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f3079f..30411e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ * Added GoogleFonts field to AppParams * Added functions: GetWhiteSpace, GetWordBreak, ScrollIntoViewIfNeeded, GetBackgroundColorPair, GetAccentColorPair, GetTextColorPair, GetTextLineColor, GetCaretColorPair, GetColumnSeparatorColorPair, ReloadListViewItem -* Added ClientSession interface -* Added ClientSession, Popups, PopupDefault, PopupDefaultsSeq, and SetPopupDefaults methods to Session interface +* Added ClientStorage interface +* Added ClientStorage, Popups, PopupDefault, PopupDefaultsSeq, and SetPopupDefaults methods to Session interface * Added ReloadListViewItem method to ListView interface * Removed ClientItem, SetClientItem, RemoveClientItem, and RemoveAllClientItems methods from Session interface * Added DismissWithoutAnimation add SetHotKey methods to Popup interface diff --git a/appServer.go b/appServer.go index e5134d9..93612d3 100644 --- a/appServer.go +++ b/appServer.go @@ -45,8 +45,8 @@ type application struct { params AppParams createContentFunc func(Session) SessionContent sessions map[int]sessionInfo - sessionsMutex sync.Mutex usedSessionIds []int + sessionsMutex sync.Mutex } func (app *application) getStartPage() string { @@ -91,6 +91,9 @@ func (app *application) getCreateContentFunc() func(Session) SessionContent { } func (app *application) nextSessionID() int { + app.sessionsMutex.Lock() + defer app.sessionsMutex.Unlock() + if app.usedSessionIds == nil { app.usedSessionIds = []int{} }