Skip to content

Commit

Permalink
a (#16538)
Browse files Browse the repository at this point in the history
Co-authored-by: DreamySkrell <>
  • Loading branch information
DreamySkrell committed Jun 26, 2023
1 parent 3d97fff commit 8f3d950
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
41 changes: 41 additions & 0 deletions html/changelogs/DreamySkrell-tgchat-namespacing-again.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################

# Your name.
author: DreamySkrell

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Chat storage namespacing."
10 changes: 7 additions & 3 deletions tgui/packages/common/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,13 @@ class IndexedDbBackend {
}
}

// Namespace for keys in storage, so we do not share storage with other servers.
var namespace = "AURORASTATION_"

Check failure on line 154 in tgui/packages/common/storage.js

View workflow job for this annotation

GitHub Actions / tgui-test

Unexpected var, use let or const instead

Check failure on line 154 in tgui/packages/common/storage.js

View workflow job for this annotation

GitHub Actions / tgui-test

Missing semicolon

Check failure on line 154 in tgui/packages/common/storage.js

View workflow job for this annotation

GitHub Actions / tgui-test

Unexpected var, use let or const instead

Check failure on line 154 in tgui/packages/common/storage.js

View workflow job for this annotation

GitHub Actions / tgui-test

Missing semicolon

/**
* Web Storage Proxy object, which selects the best backend available
* depending on the environment.
* Also applies namespacing to keys.
*/
class StorageProxy {
constructor() {
Expand All @@ -173,17 +177,17 @@ class StorageProxy {

async get(key) {
const backend = await this.backendPromise;
return backend.get(key);
return backend.get(namespace + key);
}

async set(key, value) {
const backend = await this.backendPromise;
return backend.set(key, value);
return backend.set(namespace + key, value);
}

async remove(key) {
const backend = await this.backendPromise;
return backend.remove(key);
return backend.remove(namespace + key);
}

async clear() {
Expand Down

0 comments on commit 8f3d950

Please sign in to comment.