skip revoking objecturls until the composer is completely closed
This commit is contained in:
@@ -14,7 +14,6 @@ import {IS_NATIVE} from '#/env'
|
|||||||
import {DraftItem} from './DraftItem'
|
import {DraftItem} from './DraftItem'
|
||||||
import {useDeleteDraftMutation, useDraftsQuery} from './state/queries'
|
import {useDeleteDraftMutation, useDraftsQuery} from './state/queries'
|
||||||
import {type DraftSummary} from './state/schema'
|
import {type DraftSummary} from './state/schema'
|
||||||
import {revokeAllMediaUrls} from './state/storage'
|
|
||||||
|
|
||||||
export function DraftsListDialog({
|
export function DraftsListDialog({
|
||||||
control,
|
control,
|
||||||
@@ -37,12 +36,6 @@ export function DraftsListDialog({
|
|||||||
const handleSelectDraft = useCallback(
|
const handleSelectDraft = useCallback(
|
||||||
(summary: DraftSummary) => {
|
(summary: DraftSummary) => {
|
||||||
control.close(() => {
|
control.close(() => {
|
||||||
// Revoke preview URLs
|
|
||||||
// It would be neater to do it in the `onClose` callback
|
|
||||||
// on the dialog itself, but this would wipe out the new ones
|
|
||||||
// that will be created by `onSelectDraft`
|
|
||||||
// ndb: if we miss any, it'll be handled by the composer closing
|
|
||||||
revokeAllMediaUrls()
|
|
||||||
onSelectDraft(summary)
|
onSelectDraft(summary)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -60,11 +53,7 @@ export function DraftsListDialog({
|
|||||||
() => (
|
() => (
|
||||||
<Button
|
<Button
|
||||||
label={_(msg`Back`)}
|
label={_(msg`Back`)}
|
||||||
onPress={() => {
|
onPress={() => control.close()}
|
||||||
control.close(() => {
|
|
||||||
revokeAllMediaUrls()
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
size="small"
|
size="small"
|
||||||
color="primary"
|
color="primary"
|
||||||
variant="ghost">
|
variant="ghost">
|
||||||
|
|||||||
Reference in New Issue
Block a user