You've already forked AstralRinth
style(astralrinth): show offline 1.16.4/5 launch fix notifications
This commit is contained in:
@@ -85,7 +85,7 @@ import { useCheckDisableMouseover } from '@/composables/macCssFix.js'
|
||||
import { config } from '@/config'
|
||||
import { check_reachable } from '@/helpers/auth.js'
|
||||
import { get_user, get_version } from '@/helpers/cache.js'
|
||||
import { command_listener, notification_listener, warning_listener } from '@/helpers/events.js'
|
||||
import { command_listener, info_listener, notification_listener, warning_listener } from '@/helpers/events.js'
|
||||
import { cancelLogin, get as getCreds, login, logout } from '@/helpers/mr_auth.ts'
|
||||
import { create_profile_and_install_from_file } from '@/helpers/pack'
|
||||
import { list } from '@/helpers/profile.js'
|
||||
@@ -433,6 +433,15 @@ async function setupApp() {
|
||||
}),
|
||||
)
|
||||
|
||||
await info_listener((e) =>
|
||||
addNotification({
|
||||
title: 'Info',
|
||||
text: e.message,
|
||||
type: 'info',
|
||||
autoCloseMs: 8000,
|
||||
}),
|
||||
)
|
||||
|
||||
fetch(`https://api.modrinth.com/appCriticalAnnouncement.json?version=${upstreamVersion}`)
|
||||
.then((response) => response.json())
|
||||
.then((res) => {
|
||||
|
||||
@@ -94,6 +94,11 @@ export async function warning_listener(callback) {
|
||||
return await listen('warning', (event) => callback(event.payload))
|
||||
}
|
||||
|
||||
// This code function modified by AstralRinth
|
||||
export async function info_listener(callback) {
|
||||
return await listen('info', (event) => callback(event.payload))
|
||||
}
|
||||
|
||||
export async function friend_listener(callback) {
|
||||
return await listen('friend', (event) => callback(event.payload))
|
||||
}
|
||||
|
||||
@@ -721,10 +721,11 @@ pub async fn launch_minecraft(
|
||||
|
||||
// This code is modified by AstralRinth
|
||||
if credentials.account_type == AccountType::Offline.as_lowercase_str() {
|
||||
// Will be applied only on Vanilla versions
|
||||
if version_jar == "1.16.4" || version_jar == "1.16.5" {
|
||||
let invalid_url = "https://invalid.invalid";
|
||||
let _ = emit_info(&format!(
|
||||
"[AR] Detected launch of {} on the offline account. Applying 1.16.4/5 multiplayer fixes.",
|
||||
"[AR] Detected launch of {} on the offline account. Applying vanilla 1.16.4/5multiplayer fixes.",
|
||||
version_jar
|
||||
)
|
||||
).await;
|
||||
|
||||
Reference in New Issue
Block a user