mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-11-30 18:11:44 +00:00
[compliments] fix: duplicate query param "?" in compliments module refresh url (#3967)
Checks if `this.config.remoteFile.includes` already contains a `?` - If it does, uses `&` to append the dummy parameter - If it doesn't, uses `?` to start a new query string
This commit is contained in:
@@ -47,6 +47,7 @@ planned for 2026-01-01
|
||||
- fixed problems with daylight-saving-time in weather provider `openmeto` (#3930, #3931)
|
||||
- [newsfeed] fixed header layout issue introduced with prettier njk linting (#3946)
|
||||
- [weather] fixed windy icon not showing up in pirateweather (#3957)
|
||||
- [compliments] fixed duplicate query param "?" when constructing refresh url (#3967)
|
||||
|
||||
### Updated
|
||||
|
||||
|
||||
@@ -214,8 +214,9 @@ Module.register("compliments", {
|
||||
// we need to force the server to not give us the cached result
|
||||
// create an extra property (ignored by the server handler) just so the url string is different
|
||||
// that will never be the same, using the ms value of date
|
||||
if (isRemote && this.config.remoteFileRefreshInterval !== 0) this.urlSuffix = `?dummy=${Date.now()}`;
|
||||
//
|
||||
if (isRemote && this.config.remoteFileRefreshInterval !== 0) {
|
||||
this.urlSuffix = this.config.remoteFile.includes("?") ? `&dummy=${Date.now()}` : `?dummy=${Date.now()}`;
|
||||
}
|
||||
try {
|
||||
const response = await fetch(url + this.urlSuffix);
|
||||
return await response.text();
|
||||
|
||||
Reference in New Issue
Block a user