Skip to content

Commit caa9f7d

Browse files
Merge pull request #98 from cabal-club/fix-prompts
Swap out electron prompt library so that it builds again
2 parents 7a9d022 + 500e937 commit caa9f7d

File tree

3 files changed

+281
-413
lines changed

3 files changed

+281
-413
lines changed

app/containers/sidebar.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React from 'react'
22
import { connect } from 'react-redux'
3+
import prompt from 'electron-prompt'
34

45
import { viewChannel, joinChannel, changeUsername, changeScreen } from '../actions'
56
import Avatar from './avatar'
67

7-
var Dialogs = require('smalltalk')
8-
98
const mapStateToProps = state => {
109
var cabal = state.cabals[state.currentCabal]
1110
return {
@@ -26,7 +25,12 @@ const mapDispatchToProps = dispatch => ({
2625

2726
class SidebarScreen extends React.Component {
2827
onClickNewChannel () {
29-
Dialogs.prompt('Create a channel', 'New channel name:', undefined).then((newChannelName) => {
28+
prompt({
29+
title: 'Create a channel',
30+
label: 'New channel name',
31+
value: undefined,
32+
type: 'input'
33+
}).then((newChannelName) => {
3034
if (newChannelName && newChannelName.trim().length > 0) {
3135
this.joinChannel(newChannelName)
3236
}
@@ -36,7 +40,12 @@ class SidebarScreen extends React.Component {
3640
}
3741

3842
onClickUsername () {
39-
Dialogs.prompt('Set nickname', 'What would you like to call yourself?', this.props.cabal.username).then((username) => {
43+
prompt({
44+
title: 'Set nickname',
45+
label: 'What would you like to call yourself?',
46+
value: this.props.cabal.username,
47+
type: 'input'
48+
}).then((username) => {
4049
if (username && username.trim().length > 0) {
4150
this.props.changeUsername({ username, addr: this.props.addr })
4251
}

0 commit comments

Comments
 (0)