Fix initial clip preview selection
This commit is contained in:
@@ -250,8 +250,13 @@ struct ContentView: View {
|
||||
SettingsStore.save(newSettings)
|
||||
}
|
||||
.onChange(of: processor.project) { project in
|
||||
if selectedClipID == nil {
|
||||
selectedClipID = project?.clips.first?.id
|
||||
guard let project else {
|
||||
selectedClipID = nil
|
||||
return
|
||||
}
|
||||
let orderedClips = orderedProjectClips(project.clips)
|
||||
if selectedClipID == nil || !orderedClips.contains(where: { $0.id == selectedClipID }) {
|
||||
selectedClipID = orderedClips.first?.id
|
||||
}
|
||||
}
|
||||
.onChange(of: settings.sortMode) { sortMode in
|
||||
@@ -409,6 +414,7 @@ struct ContentView: View {
|
||||
|
||||
return VStack(alignment: .leading, spacing: 8) {
|
||||
ClipPreviewView(clip: liveClip)
|
||||
.id(liveClip.sourcePath)
|
||||
.frame(height: 180)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user