mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-17 08:12:00 +02:00
Update to not logout from server when switching servers, force users to re-login if using old auth
This commit is contained in:
parent
44613e12f1
commit
f6e2e4010f
7 changed files with 105 additions and 45 deletions
|
@ -245,10 +245,35 @@ Vue.prototype.$sanitizeSlug = (str) => {
|
|||
return str
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares two semantic versioning strings to determine if the current version meets
|
||||
* or exceeds the minimum version requirement.
|
||||
* Only supports 3 part versions, e.g. "1.2.3"
|
||||
*
|
||||
* @param {string} currentVersion - The current version string to compare, e.g., "1.2.3".
|
||||
* @param {string} minVersion - The minimum version string required, e.g., "1.0.0".
|
||||
* @returns {boolean} - Returns true if the current version is greater than or equal
|
||||
* to the minimum version, false otherwise.
|
||||
*/
|
||||
function isValidVersion(currentVersion, minVersion) {
|
||||
if (!currentVersion || !minVersion) return false
|
||||
const currentParts = currentVersion.split('.').map(Number)
|
||||
const minParts = minVersion.split('.').map(Number)
|
||||
|
||||
for (let i = 0; i < minParts.length; i++) {
|
||||
if (currentParts[i] > minParts[i]) return true
|
||||
if (currentParts[i] < minParts[i]) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export default ({ store, app }, inject) => {
|
||||
const eventBus = new Vue()
|
||||
inject('eventBus', eventBus)
|
||||
|
||||
inject('isValidVersion', isValidVersion)
|
||||
|
||||
// Set theme
|
||||
app.$localStore?.getTheme()?.then((theme) => {
|
||||
if (theme) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue