mirror of
https://github.com/balzack/databag.git
synced 2025-04-23 01:55:17 +00:00
fixing upload of unsealed binary
This commit is contained in:
parent
16a72fbec7
commit
55d89107c7
@ -71,6 +71,7 @@ export const styles = StyleSheet.create({
|
||||
minWidth: 0,
|
||||
textOverflow: 'ellipsis',
|
||||
flexShrink: 1,
|
||||
height: 32,
|
||||
},
|
||||
close: {
|
||||
display: 'flex',
|
||||
@ -83,6 +84,8 @@ export const styles = StyleSheet.create({
|
||||
},
|
||||
closeIcon: {
|
||||
flexShrink: 0,
|
||||
borderRadius: 8,
|
||||
opacity: 0.7,
|
||||
},
|
||||
progress: {
|
||||
position: 'absolute',
|
||||
|
@ -101,7 +101,7 @@ export function AudioAsset({ topicId, asset, loaded, show }: { topicId: string,
|
||||
{ state.dataUrl && (
|
||||
<Video source={{ uri: state.dataUrl }} style={styles.player} paused={false} ref={videoRef}
|
||||
onPlaybackRateChange={playbackRateChange} onEnd={end} onError={actions.failed}
|
||||
controls={false} resizeMode="contain" />
|
||||
audioOnly={true} controls={false} resizeMode="contain" />
|
||||
)}
|
||||
{ status === 'playing' && (
|
||||
<Surface elevation={2} style={styles.control}>
|
||||
|
@ -40,6 +40,8 @@ export const styles = StyleSheet.create({
|
||||
flexGrow: 1,
|
||||
},
|
||||
closeIcon: {
|
||||
borderRadius: 8,
|
||||
opacity: 0.7,
|
||||
},
|
||||
progress: {
|
||||
position: 'absolute',
|
||||
|
@ -57,6 +57,8 @@ export const styles = StyleSheet.create({
|
||||
right: 0,
|
||||
},
|
||||
closeIcon: {
|
||||
borderRadius: 8,
|
||||
opacity: 0.7,
|
||||
},
|
||||
progress: {
|
||||
position: 'absolute',
|
||||
|
@ -4,6 +4,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
|
||||
.thumb {
|
||||
width: auto;
|
||||
@ -15,6 +16,10 @@
|
||||
padding-right: 2px;
|
||||
position: absolute;
|
||||
font-size: 12px;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.close {
|
||||
|
@ -18,6 +18,9 @@
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
height: 100%;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.extension {
|
||||
|
@ -271,7 +271,7 @@ export function useConversation() {
|
||||
]});
|
||||
return { encrypted: { type: 'audio', label: asset.label, parts: `ac${sources.length-1}` } };
|
||||
} else {
|
||||
sources.push({ type: AssetType.Video, source: asset.file, transforms: [
|
||||
sources.push({ type: AssetType.Audio, source: asset.file, transforms: [
|
||||
{ type: TransformType.Copy, appId: `ac${sources.length}` }
|
||||
]});
|
||||
return { audio: { label: asset.label, full: `ac${sources.length-1}` } };
|
||||
|
@ -11,6 +11,8 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.play {
|
||||
@ -46,6 +48,10 @@
|
||||
.label {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.close {
|
||||
|
@ -14,6 +14,9 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.extension {
|
||||
@ -21,6 +24,7 @@
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,6 +67,9 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.extension {
|
||||
|
@ -21,7 +21,6 @@ export function BinaryAsset({ topicId, asset }: { topicId: string, asset: MediaA
|
||||
}
|
||||
|
||||
const download = () => {
|
||||
console.log("DOWNLOAD");
|
||||
const link = document.createElement("a");
|
||||
link.download = `${label}.${extension.toLowerCase()}`
|
||||
link.href = state.dataUrl;
|
||||
|
@ -499,7 +499,7 @@ export class FocusModule implements Focus {
|
||||
transforms.push('acopy;audio');
|
||||
transformMap.set('acopy;audio', transform.appId);
|
||||
} else if (transform.type === TransformType.Copy && asset.type === AssetType.Binary) {
|
||||
const assetId = await this.mirrorFile(asset.source, topicId, assetProgress);
|
||||
const { assetId } = await this.mirrorFile(asset.source, topicId, assetProgress);
|
||||
uploadCount += 1;
|
||||
const assetItem = {
|
||||
assetId: `${assetItems.length}`,
|
||||
@ -566,7 +566,7 @@ export class FocusModule implements Focus {
|
||||
return { encrypted: { type, thumb: getAsset(thumb), parts: getAsset(parts) } };
|
||||
} else if (type === 'audio') {
|
||||
return { encrypted: { type, label, parts: getAsset(parts) } };
|
||||
}else {
|
||||
} else {
|
||||
return { encrypted: { type, label, extension, parts: getAsset(parts) } };
|
||||
}
|
||||
} else if (asset.image) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user