Skip to content

Commit

Permalink
Merge pull request #1859 from zaSmilingIdiot/maint/bugfixes
Browse files Browse the repository at this point in the history
Bug squashes
  • Loading branch information
zaSmilingIdiot authored Jun 17, 2022
2 parents ecd814a + a8fa913 commit 69dbca3
Show file tree
Hide file tree
Showing 17 changed files with 1,813 additions and 1,502 deletions.
5 changes: 1 addition & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ if (!instanceLock) {
nodeIntegration: false,
sandbox: true,
contextIsolation: false,
nativeWindowOpen: true,
webSecurity: true,
enableRemoteModule: false
}
Expand Down Expand Up @@ -306,7 +305,6 @@ if (!instanceLock) {
nodeIntegration: false,
sandbox: true,
contextIsolation: true,
nativeWindowOpen: true,
webSecurity: true,
enableRemoteModule: false,
preload: path.join(__dirname, 'preload.js')
Expand Down Expand Up @@ -408,7 +406,7 @@ if (!instanceLock) {
submenu: [
{
label: 'Open Dev Tools',
click() { mainWindow.openDevTools(); }
click() { mainWindow.webContents.openDevTools(); }
}
]
},
Expand Down Expand Up @@ -490,7 +488,6 @@ if (!instanceLock) {
nodeIntegration: false,
sandbox: true,
contextIsolation: false,
nativeWindowOpen: true,
webSecurity: true,
enableRemoteModule: false
}
Expand Down
9 changes: 7 additions & 2 deletions modules/market/market.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ exports.init = function() {
}

child.on('close', code => {
log.info('market process ended.');
if ((isStarted === null) && !observer.closed) {
if (timeoutMonitor !== null) {
// market process is busy starting up and needs to go through the correct error handling (child process closed itself)
observer.error('MP_STARTUP_FAILURE');
stop();
}
// market process is shutdown before obtaining the "ready" signal
observer.unsubscribe();
// observer.next(false);
// observer.complete();
}
resetTimeoutCheck();
log.info('market process ended.');
});

child.stdout.on('data', data => {
Expand Down Expand Up @@ -81,7 +86,7 @@ exports.init = function() {
child.stderr.on('data', data => console.log(data.toString('utf8')));

// If app is not started correctly in x seconds, stop and return a fail
timeoutMonitor = setTimeout(function () {
timeoutMonitor = setTimeout(() => {
if (isStarted === null) {
stop();
}
Expand Down
2 changes: 1 addition & 1 deletion modules/rpc/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports.call = function(method, params, callback) {

const settingsAuth = _options.getAuth();
rpcOptions.auth = settingsAuth || '';
rpcOptions.headers['Content-Length'] = postData.length;
// rpcOptions.headers['Content-Length'] = postData.length;

const request = http.request(rpcOptions, response => {
let data = '';
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"postinstall": "node build/postinstall && electron-builder install-app-deps"
},
"build": {
"electronVersion": "10.1.6",
"electronVersion": "19.0.4",
"appId": "io.particl.desktop.testnet",
"productName": "Particl Desktop Testnet",
"npmRebuild": true,
Expand Down Expand Up @@ -187,7 +187,7 @@
"@ngx-gallery/gallerize": "^5.0.0-beta.0",
"@ngx-gallery/lightbox": "^5.0.0-beta.0",
"@ngxs/store": "^3.6.0",
"@zasmilingidiot/particl-marketplace": "0.3.9",
"@zasmilingidiot/particl-marketplace": "0.3.10",
"@zasmilingidiot/particl-zmq": "1.0.7",
"angularx-qrcode": "^1.0.1",
"autodetect-decoder-stream": "^1.0.3",
Expand Down Expand Up @@ -240,10 +240,10 @@
"checksum": "^0.1.1",
"codelyzer": "^5.0.1",
"coveralls": "^3.0.0",
"electron": "10.1.6",
"electron-builder": "^22.9.1",
"electron-notarize": "^1.0.0",
"htmlhint": "^0.15.1",
"electron": "19.0.4",
"electron-builder": "^23.0.3",
"electron-notarize": "^1.2.1",
"htmlhint": "^1.1.4",
"jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.0",
"karma": "^4.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ export class BuyCartComponent implements OnInit, OnDestroy {
tap(results => {
this.cartItems = results.cartItems;
this.addresses = results.addresses;
this.modifyShippingProfile.setValue(this.addresses.length === 0);
this.updateCartExpiryTimer();
this.updateCartItemPricing();
this.cartModified.setValue(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h2 class="section-title">
</button>
</div>
<div class="status-wrap" fxFlex="0 0 140px">
<div class="sell order status" [ngClass]="orderItem.currentState.state.statusClass">
<div class="buy order status" [ngClass]="orderItem.currentState.state.statusClass">
<span class="dot"></span>{{ orderItem.currentState.state.filterLabel || orderItem.currentState.state.label }}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export class ChatChannelsComponent implements OnInit, OnDestroy {
displayChat: false,
initTab: 'default',
displayActions: {
cart: false,
cart: true,
governance: false,
fav: false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import { GenericModalInfo } from '../joined-markets.models';
enum TextContent {
ERROR_IMAGE_SIZE = 'Market image exceeds the allowed publishing size. Please change to using a paid SMSG for posting images.',
ERROR_ESTIMATING_FEE = 'Something went wrong estimating the fee',
ERROR_ESTIMATING_FEE_FUNDS = 'Insufficient funds to promote this market'
ERROR_ESTIMATING_FEE_FUNDS = 'Insufficient funds to promote this market',
ERROR_ESTIMATING_FEE_UTXOS = 'Insufficient funds to promote this market (too few utxos)',
}


Expand Down Expand Up @@ -121,8 +122,8 @@ export class PromoteMarketConfirmationModalComponent implements OnInit, OnDestro
if (typeof err === 'string') {
if (err.includes('MPA_MARKET_IMAGE_ADD size')) {
this.errorMsg = TextContent.ERROR_IMAGE_SIZE;
} else if (err.includes('Insufficient funds')) {
this.errorMsg = TextContent.ERROR_ESTIMATING_FEE_FUNDS;
} else if (err.includes('Insufficient')) {
this.errorMsg = err.includes('utxo') ? TextContent.ERROR_ESTIMATING_FEE_UTXOS : TextContent.ERROR_ESTIMATING_FEE_FUNDS;
}
}
if (!this.errorMsg) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/main-market/management/management.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@ export class MarketManagementService {
];

return this._rpc.call('market', postParams).pipe(
map((resp: RespItemPost) => {
concatMap((resp: RespItemPost) => {
if (isBasicObjectType(resp) && (+resp.fee > 0)) {
return +resp.fee;
return of(+resp.fee);
}
throwError('Invalid Estimation');
return throwError(typeof resp.error === 'string' && resp.error.includes('utxos') ? 'Insufficient utxos' : 'Invalid Estimation');
})
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/main-market/services/market-rpc/market-rpc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export class MarketRpcService {
return observableThrowError('Market service not started');
}

const postData = JSON.stringify({
const postData = {
method: method,
params: params,
id: 1,
jsonrpc: '2.0'
});
};

const headerJson = {
'Content-Type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion src/app/main-market/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ export class MarketSettingsComponent implements OnInit, OnDestroy {
connectionDetails.settings.push({
id: 'startupWaitTimeoutSeconds',
title: 'Marketplace Service Startup Timeout',
description: 'Number of seconds to wait for a successful startup response from the Marketplace service before deeming that the service has errored. Increasing this value may resolve startup issues on some slower machines (default: 60 seconds)',
description: 'Number of seconds to wait for a successful startup response from the Marketplace service before deeming that the service has errored. Increasing this value may resolve startup issues on some slower machines (default: 120 seconds)',
isDisabled: false,
type: SettingType.NUMBER,
limits: { min: 20, max: 900 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ <h2 class="section-title">Item Discussion</h2>
</p>
<p *ngIf="details.governance.voteCast === details.governance.voteOptionKeep">
<button [disabled]="!canAction" mat-button class="small icon-only" color="warn" appDebounceClick (debounceClick)="actionVoteItem('REMOVE')"
matTooltip="I've changed my mind, the item is inappropriate/illegal and should be removed from Market">
matTooltip="I've changed my mind, the item is inappropriate/illegal and should be removed">
<mat-icon fontIcon="part-thumb-down"></mat-icon>
</button>
I've changed my mind, the item is inappropriate/illegal and should be removed from Market
I've changed my mind, the item is inappropriate/illegal and should be removed
</p>
</div>
</div><!-- .reporting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ button.modal-close {

.mat-dialog-content {
margin: -24px -24px 0 !important;
width: 950px;
width: 930px;
height: calc(100vh - 120px);
max-height: none;
background: var(--bg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@
{{ txn.formattedTime }}
</div>

<!-- Confirmations -->
<div *ngIf="(txn.confirmations <= txn.requiredConfirmations)" class="confirmations" [ngClass]="styleConfimations(txn.confirmations, txn.requiredConfirmations, txn.isAbandoned)">
<div *ngIf="!txn.isAbandoned" class="confirmation-tag" matTooltip="Unconfirmed transaction" matTooltipPosition="before">
<mat-icon fontIcon="part-date" class="confirmations"></mat-icon>
{{ txn.confirmations }}/{{txn.requiredConfirmations}}
</div>

<div *ngIf="txn.isAbandoned" class="confirmation-tag" matTooltip="Abandoned/Cancelled transaction" matTooltipPosition="before">
<mat-icon fontIcon="part-error" class="confirmations"></mat-icon>
Cancelled
</div>
</div>

<!-- Category icon -->
<div class="type">

Expand Down Expand Up @@ -108,6 +95,21 @@

</div>


<!-- Confirmations -->
<div *ngIf="(txn.confirmations <= txn.requiredConfirmations)" class="confirmations" [ngClass]="styleConfimations(txn.confirmations, txn.requiredConfirmations, txn.isAbandoned)">
<div *ngIf="!txn.isAbandoned" class="confirmation-tag" matTooltip="Unconfirmed transaction" matTooltipPosition="before">
<mat-icon fontIcon="part-date" class="confirmations"></mat-icon>
{{ txn.confirmations }}/{{txn.requiredConfirmations}}
</div>

<div *ngIf="txn.isAbandoned" class="confirmation-tag" matTooltip="Abandoned/Cancelled transaction" matTooltipPosition="before">
<mat-icon fontIcon="part-error" class="confirmations"></mat-icon>
Cancelled
</div>
</div>


<!-- Amount -->
<div class="tx-value">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@

// TX amount
.tx-value {
flex: 1 0 135px;
// flex: 1 0 135px;
text-align: right;
font-family: var(--font-mono);
display: block;
Expand Down
1 change: 1 addition & 0 deletions src/assets/scss/_material-components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ mat-expansion-panel.mat-expansion-panel {
position: relative;
max-width: 1000px;
padding: 18px 24px 24px;
overflow-y: hidden;
.modal-close { // new modal close button (use with `mat-button color="warn"`
@extend %tfx;
position: absolute;
Expand Down
Loading

0 comments on commit 69dbca3

Please sign in to comment.