mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 00:51:26 +00:00
Fixes performance killing potential bug with VueUi (#5199)
So apparently when conditions are right it could make infinite loop (client push -> server receive -> server push -> client receive -> client push...) killing client and server performance. <vui-button> now pushes data as JSON, this preserves data structure of parameters Store now won't allow state to be pushed if it was very recently received There was a plausibly for vueui/Topic() to push data twice, hindering performance. This was mitigated by taking in to consideration object Topic return value if data should pushed. Separated some code in to separate file for future reusal or programical uses.
This commit is contained in:
12
vueui/src/utils.js
Normal file
12
vueui/src/utils.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Store from './store.js'
|
||||
export default {
|
||||
sendToTopic(data, pushState = false) {
|
||||
var r = new XMLHttpRequest()
|
||||
var sendUrl = "?src=" + Store.state.uiref + "&vueuihrefjson=" + encodeURIComponent(JSON.stringify(data))
|
||||
if (pushState) {
|
||||
sendUrl += "&" + Store.getStatePushString()
|
||||
}
|
||||
r.open("GET", sendUrl, true);
|
||||
r.send()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user