Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for QR codes #172

Merged
merged 12 commits into from
Feb 19, 2024
11 changes: 7 additions & 4 deletions core/src/services/relations-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ export class RelationsManager {
private persistIt(document: Document|NewDocument,
squashRevisionIds: string[]): Promise<Document> {

return document.resource.id
? this.datastore.update(
if ('created' in document){
return this.datastore.update(
document as Document,
squashRevisionIds.length === 0 ? undefined : squashRevisionIds)
: this.datastore.create(document);
squashRevisionIds.length === 0 ? undefined : squashRevisionIds
)
}

return this.datastore.create(document);
}


Expand Down
9 changes: 9 additions & 0 deletions desktop/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,15 @@ const createWindow = () => {
titleBarStyle: 'hiddenInset'
});

// electron.desktopCapturer.getSources({ types: ['window', 'screen'] }).then(async sources => {
// for (const source of sources) {
// if (source.name === 'Field Desktop') {
// mainWindow.webContents.send('SET_SOURCE', source.id)
// return
// }
// }
// })

remoteMain.enable(mainWindow.webContents);

if (require('os').platform() === 'linux' && global.mode === 'production') {
Expand Down
32 changes: 32 additions & 0 deletions desktop/electron/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,35 @@ window.filesystem.extractZip = function(source, destination) {
window.filesystem.createCatalogZip = function(outputFilePath, filePath, fileName, imageDirPath, imageDirName) {
return ipcRenderer.invoke('createCatalogZip', outputFilePath, filePath, fileName, imageDirPath, imageDirName);
};

// ipcRenderer.on('SET_SOURCE', async (event, sourceId) => {
// try {
// const stream = await navigator.mediaDevices.getUserMedia({
// audio: false,
// video: {
// mandatory: {
// chromeMediaSource: 'desktop',
// chromeMediaSourceId: sourceId,
// minWidth: 1280,
// maxWidth: 1280,
// minHeight: 720,
// maxHeight: 720
// }
// }
// })
// handleStream(stream)
// } catch (e) {
// handleError(e)
// }
// })


// function handleStream (stream) {
// const video = document.querySelector('video')
// video.srcObject = stream
// video.onloadedmetadata = (e) => video.play()
// }

// function handleError (e) {
// console.log(e)
// }
Loading
Loading