Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b94e7dbbe |
No files matched your search
@@ -197,27 +197,6 @@ export function useOnboardingTour(
|
||||
requestAnimationFrame(updateRect)
|
||||
}
|
||||
|
||||
// Bring the current step target into view when the tour jumps to a step
|
||||
// whose target lives inside a scrollable container (e.g. the settings
|
||||
// sidebar). Without this the bubble can point at an off-screen element.
|
||||
function ensureTargetVisible() {
|
||||
const target = targetElement.value
|
||||
if (!target) return
|
||||
const rect = target.getBoundingClientRect()
|
||||
const outOfView =
|
||||
rect.top < 0 ||
|
||||
rect.left < 0 ||
|
||||
rect.bottom > window.innerHeight ||
|
||||
rect.right > window.innerWidth
|
||||
if (!outOfView) return
|
||||
target.scrollIntoView({ block: 'center', inline: 'nearest', behavior: 'smooth' })
|
||||
requestAnimationFrame(() => {
|
||||
if (targetElement.value === target) {
|
||||
targetRect.value = target.getBoundingClientRect()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function goTo(destination: StepDestination) {
|
||||
if (destination === 'complete') {
|
||||
events.complete()
|
||||
@@ -364,7 +343,6 @@ export function useOnboardingTour(
|
||||
await nextTick()
|
||||
updateBubbleSize()
|
||||
updateTarget()
|
||||
ensureTargetVisible()
|
||||
})
|
||||
|
||||
watch(mode, () => {
|
||||
|
||||
@@ -339,7 +339,7 @@ fn get_launcher_root_dir() -> api::Result<String> {
|
||||
fn get_update_channel(app: tauri::AppHandle) -> api::Result<String> {
|
||||
let channel = read_update_channel_state(&app)?
|
||||
.active_channel
|
||||
.unwrap_or_else(|| "release".to_string());
|
||||
.unwrap_or_else(|| theseus::default_update_channel().to_string());
|
||||
|
||||
match channel.as_str() {
|
||||
"release" | "beta" => Ok(channel),
|
||||
|
||||
@@ -33,7 +33,7 @@ pub use logger::start_logger;
|
||||
pub use state::db::{
|
||||
backup_current_app_db_for_update, beta_database_exists,
|
||||
copy_database_between_channels, copy_release_database_to_beta,
|
||||
current_app_database_path,
|
||||
current_app_database_path, default_update_channel,
|
||||
};
|
||||
pub use state::{DirectoryInfo, State};
|
||||
pub use storage::*;
|
||||
|
||||
@@ -304,6 +304,18 @@ async fn app_db_path(settings_dir: &Path) -> crate::Result<PathBuf> {
|
||||
Ok(settings_dir.join(channel).join(LEGACY_APP_DB_FILE))
|
||||
}
|
||||
|
||||
/// The update channel a fresh install should default to. Beta builds carry a
|
||||
/// pre-release version (e.g. `1.0.2-beta7`), so their installers should start
|
||||
/// on the Beta channel instead of silently falling back to Release.
|
||||
pub fn default_update_channel() -> &'static str {
|
||||
let version = env!("CARGO_PKG_VERSION");
|
||||
if version.contains('-') {
|
||||
"beta"
|
||||
} else {
|
||||
"release"
|
||||
}
|
||||
}
|
||||
|
||||
async fn read_update_channel(
|
||||
settings_dir: &Path,
|
||||
) -> crate::Result<&'static str> {
|
||||
@@ -311,7 +323,7 @@ async fn read_update_channel(
|
||||
let contents = match tokio::fs::read_to_string(&path).await {
|
||||
Ok(contents) => contents,
|
||||
Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
|
||||
return Ok("release");
|
||||
return Ok(default_update_channel());
|
||||
}
|
||||
Err(error) => return Err(error.into()),
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user