refactor: comments

This commit is contained in:
2025-07-10 21:32:44 +03:00
parent 6dfb599e14
commit 3d32640b83
10 changed files with 23 additions and 19 deletions

View File

@@ -188,7 +188,7 @@ async function setupApp() {
}), }),
) )
// Patched by AstralRinth /// [AR] Patch
// useFetch( // useFetch(
// `https://api.modrinth.com/appCriticalAnnouncement.json?version=${version}`, // `https://api.modrinth.com/appCriticalAnnouncement.json?version=${version}`,
// 'criticalAnnouncements', // 'criticalAnnouncements',

View File

@@ -153,11 +153,11 @@ const loginErrorModal = ref(null)
const unexpectedErrorModal = ref(null) const unexpectedErrorModal = ref(null)
const playerName = ref('') const playerName = ref('')
async function tryOfflineLogin() { // Patched by AstralRinth async function tryOfflineLogin() { // [AR] Feature
loginOfflineModal.value.show() loginOfflineModal.value.show()
} }
async function offlineLoginFinally() { // Patched by AstralRinth async function offlineLoginFinally() { // [AR] Feature
const name = playerName.value const name = playerName.value
if (name.length > 1 && name.length < 20 && name !== '') { if (name.length > 1 && name.length < 20 && name !== '') {
const loggedIn = await offline_login(name).catch(handleError) const loggedIn = await offline_login(name).catch(handleError)
@@ -176,12 +176,12 @@ async function offlineLoginFinally() { // Patched by AstralRinth
} }
} }
function retryOfflineLogin() { // Patched by AstralRinth function retryOfflineLogin() { // [AR] Feature
loginErrorModal.value.hide() loginErrorModal.value.hide()
tryOfflineLogin() tryOfflineLogin()
} }
function getAccountType(account) { // Patched by AstralRinth function getAccountType(account) { // [AR] Feature
if (account.access_token != "null" && account.access_token != null && account.access_token != "") { if (account.access_token != "null" && account.access_token != null && account.access_token != "") {
return License return License
} else { } else {

View File

@@ -30,7 +30,7 @@ watch(
option, you opt out and ads will no longer be shown based on your interests. option, you opt out and ads will no longer be shown based on your interests.
</p> </p>
</div> </div>
<!-- AstralRinth disabled element by default --> <!-- [AR] Patch. Disabled element by default -->
<Toggle id="personalized-ads" v-model="settings.personalized_ads" :disabled="!settings.personalized_ads" /> <Toggle id="personalized-ads" v-model="settings.personalized_ads" :disabled="!settings.personalized_ads" />
</div> </div>
@@ -43,7 +43,7 @@ watch(
longer be collected. longer be collected.
</p> </p>
</div> </div>
<!-- AstralRinth disabled element by default --> <!-- [AR] Patch. Disabled element by default -->
<Toggle id="opt-out-analytics" v-model="settings.telemetry" :disabled="!settings.telemetry" /> <Toggle id="opt-out-analytics" v-model="settings.telemetry" :disabled="!settings.telemetry" />
</div> </div>

View File

@@ -14,7 +14,7 @@ use chrono::Utc;
use daedalus as d; use daedalus as d;
use daedalus::minecraft::{LoggingSide, RuleAction, VersionInfo}; use daedalus::minecraft::{LoggingSide, RuleAction, VersionInfo};
use daedalus::modded::LoaderVersion; use daedalus::modded::LoaderVersion;
use rand::seq::SliceRandom; // AstralRinth use rand::seq::SliceRandom; // [AR] Feature
use regex::Regex; use regex::Regex;
use serde::Deserialize; use serde::Deserialize;
use st::Profile; use st::Profile;
@@ -633,7 +633,7 @@ pub async fn launch_minecraft(
command.arg("--add-opens=jdk.internal/jdk.internal.misc=ALL-UNNAMED"); command.arg("--add-opens=jdk.internal/jdk.internal.misc=ALL-UNNAMED");
} }
// Patched by AstralRinth // [AR] Patch
if credentials.access_token == "null" && credentials.refresh_token == "null" { if credentials.access_token == "null" && credentials.refresh_token == "null" {
if version_jar == "1.16.4" || version_jar == "1.16.5" { if version_jar == "1.16.4" || version_jar == "1.16.5" {
let invalid_url = "https://invalid.invalid"; let invalid_url = "https://invalid.invalid";
@@ -743,6 +743,7 @@ pub async fn launch_minecraft(
} }
} }
// [AR] Feature
let selected_phrase = ACTIVE_STATE.choose(&mut rand::thread_rng()).unwrap(); let selected_phrase = ACTIVE_STATE.choose(&mut rand::thread_rng()).unwrap();
let _ = state let _ = state
.discord_rpc .discord_rpc

View File

@@ -23,6 +23,7 @@ pub(crate) async fn connect() -> crate::Result<Pool<Sqlite>> {
Ok(pool) Ok(pool)
} }
// [AR] Feature. Implement SQLite3 connection without SQLx migrations.
async fn connect_without_migrate() -> crate::Result<Pool<Sqlite>> { async fn connect_without_migrate() -> crate::Result<Pool<Sqlite>> {
let settings_dir = DirectoryInfo::get_initial_settings_dir().ok_or( let settings_dir = DirectoryInfo::get_initial_settings_dir().ok_or(
ErrorKind::FSError("Could not find valid config dir".to_string()), ErrorKind::FSError("Could not find valid config dir".to_string()),
@@ -71,7 +72,7 @@ async fn stale_data_cleanup(pool: &Pool<Sqlite>) -> crate::Result<()> {
Ok(()) Ok(())
} }
/* /*
// Patched by AstralRinth // [AR] Patch fix
Problem files, view detailed information in .gitattributes: Problem files, view detailed information in .gitattributes:
/packages/app-lib/migrations/20240711194701_init.sql !eol /packages/app-lib/migrations/20240711194701_init.sql !eol
CRLF -> 4c47e326f16f2b1efca548076ce638d4c90dd610172fe48c47d6de9bc46ef1c5abeadfdea05041ddd72c3819fa10c040 CRLF -> 4c47e326f16f2b1efca548076ce638d4c90dd610172fe48c47d6de9bc46ef1c5abeadfdea05041ddd72c3819fa10c040

View File

@@ -22,6 +22,7 @@ pub struct DirectoryInfo {
impl DirectoryInfo { impl DirectoryInfo {
// Get the settings directory // Get the settings directory
// init() is not needed for this function // init() is not needed for this function
// [AR] Patch fix. From PR.
pub fn get_initial_settings_dir() -> Option<PathBuf> { pub fn get_initial_settings_dir() -> Option<PathBuf> {
Self::env_path("THESEUS_CONFIG_DIR").or_else(|| { Self::env_path("THESEUS_CONFIG_DIR").or_else(|| {
if std::env::current_dir().ok()?.join("portable.txt").exists() { if std::env::current_dir().ok()?.join("portable.txt").exists() {

View File

@@ -1,16 +1,17 @@
// [AR] Feature
use std::{ use std::{
sync::{atomic::AtomicBool, Arc}, sync::{atomic::AtomicBool, Arc},
time::{SystemTime, UNIX_EPOCH}, // AstralRinth time::{SystemTime, UNIX_EPOCH},
}; };
use discord_rich_presence::{ use discord_rich_presence::{
activity::{Activity, Assets, Timestamps}, // AstralRinth activity::{Activity, Assets, Timestamps}, // [AR] Feature
DiscordIpc, DiscordIpcClient, DiscordIpc, DiscordIpcClient,
}; };
use rand::seq::SliceRandom; // AstralRinth use rand::seq::SliceRandom; // [AR] Feature
use tokio::sync::RwLock; use tokio::sync::RwLock;
use crate::util::utils; // AstralRinth use crate::util::utils; // [AR] Feature
use crate::State; use crate::State;
pub struct DiscordGuard { pub struct DiscordGuard {

View File

@@ -213,7 +213,7 @@ pub async fn login_finish(
Ok(credentials) Ok(credentials)
} }
// Patched by AstralRinth // [AR] Feature
#[tracing::instrument] #[tracing::instrument]
pub async fn offline_auth( pub async fn offline_auth(
name: &str, name: &str,
@@ -790,7 +790,7 @@ const MICROSOFT_CLIENT_ID: &str = "00000000402b5328";
const REDIRECT_URL: &str = "https://login.live.com/oauth20_desktop.srf"; const REDIRECT_URL: &str = "https://login.live.com/oauth20_desktop.srf";
const REQUESTED_SCOPES: &str = "service::user.auth.xboxlive.com::MBI_SSL"; const REQUESTED_SCOPES: &str = "service::user.auth.xboxlive.com::MBI_SSL";
/* AstralRinth /* [AR] Fix
* Weird visibility issue that didn't reproduce before * Weird visibility issue that didn't reproduce before
* Had to make DeviceToken and RequestWithDate pub(crate) to fix compilation error * Had to make DeviceToken and RequestWithDate pub(crate) to fix compilation error
*/ */

View File

@@ -3,5 +3,5 @@ pub mod fetch;
pub mod io; pub mod io;
pub mod jre; pub mod jre;
pub mod platform; pub mod platform;
pub mod utils; // AstralRinth pub mod utils; // [AR] Feature
pub mod server_ping; pub mod server_ping;

View File

@@ -83,14 +83,14 @@ export const TwitterIcon = _TwitterIcon
export const WindowsIcon = _WindowsIcon export const WindowsIcon = _WindowsIcon
export const YouTubeIcon = _YouTubeIcon export const YouTubeIcon = _YouTubeIcon
// AstralRinth Icons // [AR] Feature. Icons
import _PirateIcon from './icons/pirate.svg?component' import _PirateIcon from './icons/pirate.svg?component'
import _MicrosoftIcon from './icons/microsoft.svg?component' import _MicrosoftIcon from './icons/microsoft.svg?component'
import _PirateShipIcon from './icons/pirate-ship.svg?component' import _PirateShipIcon from './icons/pirate-ship.svg?component'
import _AstralRinthLogo from './icons/astralrinth-logo.svg?component' import _AstralRinthLogo from './icons/astralrinth-logo.svg?component'
// AstralRinth Exports // [AR] Feature. Exports
export const PirateIcon = _PirateIcon export const PirateIcon = _PirateIcon
export const MicrosoftIcon = _MicrosoftIcon export const MicrosoftIcon = _MicrosoftIcon