mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	upd: add boost settings
This commit is contained in:
		
							parent
							
								
									b928446ddd
								
							
						
					
					
						commit
						c9ca1dd3f1
					
				
					 8 changed files with 233 additions and 180 deletions
				
			
		| 
						 | 
				
			
			@ -399,6 +399,9 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
function boostVisibility() {
 | 
			
		||||
	if (!defaultStore.state.showVisibilitySelectorOnBoost) {
 | 
			
		||||
		renote(defaultStore.state.visibilityOnBoost);
 | 
			
		||||
	} else {
 | 
			
		||||
		os.popupMenu([
 | 
			
		||||
			{
 | 
			
		||||
				type: 'button',
 | 
			
		||||
| 
						 | 
				
			
			@ -433,6 +436,7 @@ function boostVisibility() {
 | 
			
		|||
				},
 | 
			
		||||
			}], renoteButton.value);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function renote(visibility: Visibility | 'local') {
 | 
			
		||||
	pleaseLogin();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -441,6 +441,9 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
function boostVisibility() {
 | 
			
		||||
	if (!defaultStore.state.showVisibilitySelectorOnBoost) {
 | 
			
		||||
		renote(defaultStore.state.visibilityOnBoost);
 | 
			
		||||
	} else {
 | 
			
		||||
		os.popupMenu([
 | 
			
		||||
			{
 | 
			
		||||
				type: 'button',
 | 
			
		||||
| 
						 | 
				
			
			@ -475,6 +478,7 @@ function boostVisibility() {
 | 
			
		|||
				},
 | 
			
		||||
			}], renoteButton.value);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function renote(visibility: Visibility | 'local') {
 | 
			
		||||
	pleaseLogin();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -269,6 +269,9 @@ watch(() => props.expandAllCws, (expandAllCws) => {
 | 
			
		|||
});
 | 
			
		||||
 | 
			
		||||
function boostVisibility() {
 | 
			
		||||
	if (!defaultStore.state.showVisibilitySelectorOnBoost) {
 | 
			
		||||
		renote(defaultStore.state.visibilityOnBoost);
 | 
			
		||||
	} else {
 | 
			
		||||
		os.popupMenu([
 | 
			
		||||
			{
 | 
			
		||||
				type: 'button',
 | 
			
		||||
| 
						 | 
				
			
			@ -303,6 +306,7 @@ function boostVisibility() {
 | 
			
		|||
				},
 | 
			
		||||
			}], renoteButton.value);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') {
 | 
			
		||||
	pleaseLogin();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -400,6 +400,9 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
function boostVisibility() {
 | 
			
		||||
	if (!defaultStore.state.showVisibilitySelectorOnBoost) {
 | 
			
		||||
		renote(defaultStore.state.visibilityOnBoost);
 | 
			
		||||
	} else {
 | 
			
		||||
		os.popupMenu([
 | 
			
		||||
			{
 | 
			
		||||
				type: 'button',
 | 
			
		||||
| 
						 | 
				
			
			@ -434,6 +437,7 @@ function boostVisibility() {
 | 
			
		|||
				},
 | 
			
		||||
			}], renoteButton.value);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function renote(visibility: Visibility | 'local') {
 | 
			
		||||
	pleaseLogin();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -449,6 +449,9 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
function boostVisibility() {
 | 
			
		||||
	if (!defaultStore.state.showVisibilitySelectorOnBoost) {
 | 
			
		||||
		renote(defaultStore.state.visibilityOnBoost);
 | 
			
		||||
	} else {
 | 
			
		||||
		os.popupMenu([
 | 
			
		||||
			{
 | 
			
		||||
				type: 'button',
 | 
			
		||||
| 
						 | 
				
			
			@ -483,6 +486,7 @@ function boostVisibility() {
 | 
			
		|||
				},
 | 
			
		||||
			}], renoteButton.value);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function renote(visibility: Visibility | 'local') {
 | 
			
		||||
	pleaseLogin();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -278,6 +278,9 @@ watch(() => props.expandAllCws, (expandAllCws) => {
 | 
			
		|||
});
 | 
			
		||||
 | 
			
		||||
function boostVisibility() {
 | 
			
		||||
	if (!defaultStore.state.showVisibilitySelectorOnBoost) {
 | 
			
		||||
		renote(defaultStore.state.visibilityOnBoost);
 | 
			
		||||
	} else {
 | 
			
		||||
		os.popupMenu([
 | 
			
		||||
			{
 | 
			
		||||
				type: 'button',
 | 
			
		||||
| 
						 | 
				
			
			@ -312,6 +315,7 @@ function boostVisibility() {
 | 
			
		|||
				},
 | 
			
		||||
			}], renoteButton.value);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') {
 | 
			
		||||
	pleaseLogin();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -190,6 +190,23 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
				<template #caption>{{ i18n.ts.numberOfPageCacheDescription }}</template>
 | 
			
		||||
			</MkRange>
 | 
			
		||||
 | 
			
		||||
			<MkFolder>
 | 
			
		||||
				<template #label>Boost Settings</template>
 | 
			
		||||
				<div class="_gaps_m">
 | 
			
		||||
					<MkSwitch v-model="showVisibilitySelectorOnBoost">
 | 
			
		||||
						Disable Visibility Selector
 | 
			
		||||
						<template #caption>Disables the visiblity selector when clicking boost and uses the default visiblity defined</template>
 | 
			
		||||
					</MkSwitch>
 | 
			
		||||
					<MkSelect v-model="visibilityOnBoost">
 | 
			
		||||
						<template #label>Default boost visibility</template>
 | 
			
		||||
						<option value="public">{{ i18n.ts._visibility['public'] }}</option>
 | 
			
		||||
						<option value="home">{{ i18n.ts._visibility['home'] }}</option>
 | 
			
		||||
						<option value="followers">{{ i18n.ts._visibility['followers'] }}</option>
 | 
			
		||||
						<option value="local">{{ i18n.ts._timelines.local }}</option>
 | 
			
		||||
					</MkSelect>
 | 
			
		||||
				</div>
 | 
			
		||||
			</MkFolder>
 | 
			
		||||
 | 
			
		||||
			<MkFolder>
 | 
			
		||||
				<template #label>{{ i18n.ts.dataSaver }}</template>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -326,6 +343,8 @@ const noteDesign = computed(defaultStore.makeGetterSetter('noteDesign'));
 | 
			
		|||
const uncollapseCW = computed(defaultStore.makeGetterSetter('uncollapseCW'));
 | 
			
		||||
const expandLongNote = computed(defaultStore.makeGetterSetter('expandLongNote'));
 | 
			
		||||
const enableSeasonalScreenEffect = computed(defaultStore.makeGetterSetter('enableSeasonalScreenEffect'));
 | 
			
		||||
const showVisibilitySelectorOnBoost = computed(defaultStore.makeGetterSetter('showVisibilitySelectorOnBoost'));
 | 
			
		||||
const visibilityOnBoost = computed(defaultStore.makeGetterSetter('visibilityOnBoost'));
 | 
			
		||||
 | 
			
		||||
watch(lang, () => {
 | 
			
		||||
	miLocalStorage.setItem('lang', lang.value as string);
 | 
			
		||||
| 
						 | 
				
			
			@ -381,6 +400,8 @@ watch([
 | 
			
		|||
	keepScreenOn,
 | 
			
		||||
	disableStreamingTimeline,
 | 
			
		||||
	enableSeasonalScreenEffect,
 | 
			
		||||
	showVisibilitySelectorOnBoost,
 | 
			
		||||
	visibilityOnBoost,
 | 
			
		||||
], async () => {
 | 
			
		||||
	await reloadAsk();
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -151,6 +151,14 @@ export const defaultStore = markRaw(new Storage('base', {
 | 
			
		|||
		where: 'account',
 | 
			
		||||
		default: true,
 | 
			
		||||
	},
 | 
			
		||||
	showVisibilitySelectorOnBoost: {
 | 
			
		||||
		where: 'account',
 | 
			
		||||
		default: true,
 | 
			
		||||
	},
 | 
			
		||||
	visibilityOnBoost: {
 | 
			
		||||
		where: 'account',
 | 
			
		||||
		default: 'public' as 'public' | 'home' | 'followers' | 'local',
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
	menu: {
 | 
			
		||||
		where: 'deviceAccount',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue