Skip to content

Commit

Permalink
Fix: watching uic config for rcc.
Browse files Browse the repository at this point in the history
Also, update the rxjs 7.0.0 iif syntax.
  • Loading branch information
seanwu1105 committed May 3, 2021
1 parent ad32f35 commit 8da7769
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/tools/lupdate.ts
@@ -1,5 +1,5 @@
import * as path from 'path';
import { iif } from 'rxjs';
import { EMPTY, iif } from 'rxjs';
import { mergeMap, switchMap } from 'rxjs/operators';
import * as vscode from 'vscode';
import {
Expand Down Expand Up @@ -55,7 +55,7 @@ const uiFileWatcher$ = createFileWatcher$('**/*.ui');

export const liveExecution$ = enabled$('lupdate').pipe(
switchMap(enabled =>
iif(() => enabled, uiFileWatcher$.pipe(watchFileChangedAndCreated()))
iif(() => enabled, uiFileWatcher$.pipe(watchFileChangedAndCreated()), EMPTY)
),
mergeMap(uri => updateTranslation(uri))
);
10 changes: 7 additions & 3 deletions src/tools/rcc.ts
@@ -1,4 +1,4 @@
import { iif } from 'rxjs';
import { EMPTY, iif } from 'rxjs';
import { mergeMap, switchMap } from 'rxjs/operators';
import * as vscode from 'vscode';
import {
Expand Down Expand Up @@ -33,9 +33,13 @@ export async function compileResource(fileUri?: vscode.Uri) {

const qrcFileWatcher$ = createFileWatcher$('**/*.qrc');

export const liveExecution$ = enabled$('uic').pipe(
export const liveExecution$ = enabled$('rcc').pipe(
switchMap(enabled =>
iif(() => enabled, qrcFileWatcher$.pipe(watchFileChangedAndCreated()))
iif(
() => enabled,
qrcFileWatcher$.pipe(watchFileChangedAndCreated()),
EMPTY
)
),
mergeMap(uri => compileResource(uri))
);
4 changes: 2 additions & 2 deletions src/tools/uic.ts
@@ -1,4 +1,4 @@
import { iif } from 'rxjs';
import { EMPTY, iif } from 'rxjs';
import { mergeMap, switchMap } from 'rxjs/operators';
import * as vscode from 'vscode';
import {
Expand Down Expand Up @@ -34,7 +34,7 @@ const uiFileWatcher$ = createFileWatcher$('**/*.ui');

export const liveExecution$ = enabled$('uic').pipe(
switchMap(enabled =>
iif(() => enabled, uiFileWatcher$.pipe(watchFileChangedAndCreated()))
iif(() => enabled, uiFileWatcher$.pipe(watchFileChangedAndCreated()), EMPTY)
),
mergeMap(uri => compileForm(uri))
);

0 comments on commit 8da7769

Please sign in to comment.