You've already forked AstralRinth
forked from didirus/AstralRinth
feat: add info event listener and payload for enhanced event handling
- Implemented `info_listener` in `events.js` to listen for 'info' events and handle payloads. - Added `emit_info` function in `emit.rs` to emit 'info' events with a message payload. - Defined `InfoPayload` struct in `mod.rs` to structure the data for 'info' events. - Integrated `emit_info` calls in the Minecraft launch logic to provide feedback on account types. - Introduced a new offline icon in SVG format and removed outdated pirate icons from assets. - Updated asset index to include the new offline icon and removed references to deleted icons.
This commit is contained in:
@@ -73,7 +73,7 @@ import { useCheckDisableMouseover } from '@/composables/macCssFix.js'
|
||||
import { debugAnalytics, initAnalytics, optOutAnalytics, trackEvent } from '@/helpers/analytics'
|
||||
import { check_reachable } from '@/helpers/auth.js'
|
||||
import { get_user } from '@/helpers/cache.js'
|
||||
import { command_listener, warning_listener } from '@/helpers/events.js'
|
||||
import { command_listener, warning_listener, info_listener } from '@/helpers/events.js'
|
||||
import { useFetch } from '@/helpers/fetch.js'
|
||||
import { cancelLogin, get as getCreds, login, logout } from '@/helpers/mr_auth.ts'
|
||||
import { list } from '@/helpers/profile.js'
|
||||
@@ -286,6 +286,15 @@ async function setupApp() {
|
||||
}),
|
||||
)
|
||||
|
||||
// [AR] Info listener
|
||||
await info_listener((e) =>
|
||||
addNotification({
|
||||
title: 'Info',
|
||||
text: e.message,
|
||||
type: 'info',
|
||||
}),
|
||||
)
|
||||
|
||||
useFetch(
|
||||
`https://api.modrinth.com/appCriticalAnnouncement.json?version=${version}`,
|
||||
'criticalAnnouncements',
|
||||
|
||||
Reference in New Issue
Block a user