kopia lustrzana https://github.com/elk-zone/elk
				
				
				
			
							rodzic
							
								
									54f020b165
								
							
						
					
					
						commit
						da7cc78a7e
					
				|  | @ -27,7 +27,7 @@ const emit = defineEmits<{ | ||||||
| const { t } = useI18n() | const { t } = useI18n() | ||||||
| 
 | 
 | ||||||
| const draftState = useDraft(draftKey, initial) | const draftState = useDraft(draftKey, initial) | ||||||
| const { draft, isEmpty } = $(draftState) | const { draft } = $(draftState) | ||||||
| 
 | 
 | ||||||
| const { | const { | ||||||
|   isExceedingAttachmentLimit, isUploading, failedAttachments, isOverDropZone, |   isExceedingAttachmentLimit, isUploading, failedAttachments, isOverDropZone, | ||||||
|  | @ -48,8 +48,6 @@ const { editor } = useTiptap({ | ||||||
|     set: (newVal) => { |     set: (newVal) => { | ||||||
|       draft.params.status = newVal |       draft.params.status = newVal | ||||||
|       draft.lastUpdated = Date.now() |       draft.lastUpdated = Date.now() | ||||||
|       if (isEmpty) |  | ||||||
|         clearEmptyDrafts() |  | ||||||
|     }, |     }, | ||||||
|   }), |   }), | ||||||
|   placeholder: computed(() => placeholder ?? draft.params.inReplyToId ? t('placeholder.replying') : t('placeholder.default_1')), |   placeholder: computed(() => placeholder ?? draft.params.inReplyToId ? t('placeholder.replying') : t('placeholder.default_1')), | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ export function getDefaultDraft(options: Partial<Mutable<mastodon.v1.CreateStatu | ||||||
|     params: { |     params: { | ||||||
|       status: status || '', |       status: status || '', | ||||||
|       inReplyToId, |       inReplyToId, | ||||||
|       visibility: currentUser.value?.account.source.privacy || visibility || 'public', |       visibility: visibility || 'public', | ||||||
|       sensitive: sensitive ?? false, |       sensitive: sensitive ?? false, | ||||||
|       spoilerText: spoilerText || '', |       spoilerText: spoilerText || '', | ||||||
|       language: language || '', // auto inferred from current language on posting
 |       language: language || '', // auto inferred from current language on posting
 | ||||||
|  | @ -141,7 +141,7 @@ export function directMessageUser(account: mastodon.v1.Account) { | ||||||
| 
 | 
 | ||||||
| export function clearEmptyDrafts() { | export function clearEmptyDrafts() { | ||||||
|   for (const key in currentUserDrafts.value) { |   for (const key in currentUserDrafts.value) { | ||||||
|     if (builtinDraftKeys.includes(key) && !isEmptyDraft(currentUserDrafts.value[key])) |     if (builtinDraftKeys.includes(key)) | ||||||
|       continue |       continue | ||||||
|     if (!currentUserDrafts.value[key].params || isEmptyDraft(currentUserDrafts.value[key])) |     if (!currentUserDrafts.value[key].params || isEmptyDraft(currentUserDrafts.value[key])) | ||||||
|       delete currentUserDrafts.value[key] |       delete currentUserDrafts.value[key] | ||||||
|  |  | ||||||
		Ładowanie…
	
		Reference in New Issue
	
	 Joaquín Sánchez
						Joaquín Sánchez