Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/disco/components/Addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ export function mapDispatchToProps(dispatch, { _tracking = tracking,
[EXTENSION_TYPE]: 'addon',
[THEME_TYPE]: 'theme',
}[type] || 'invalid';
dispatch({ type: INSTALL_STATE, payload: { guid, status: UNINSTALLING } });
return _addonManager.uninstall(guid)
.then(() => {
_tracking.sendEvent({
Expand Down
10 changes: 6 additions & 4 deletions src/disco/css/InstallButton.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $installStripeColor2: #00c42e;
}
}

@mixin stripes($color1, $color2) {
@mixin stripes($color1, $color2, $stripeBackgroundColor) {
animation: stripes 0.5s linear infinite;
background-image:
repeating-linear-gradient(
Expand All @@ -47,7 +47,7 @@ $installStripeColor2: #00c42e;
$color1 50%
);
background-size: $size/2 $size/2;
background-color: $switchBackgroundOn;
background-color: $stripeBackgroundColor;
}

.switch {
Expand Down Expand Up @@ -113,7 +113,8 @@ $installStripeColor2: #00c42e;
input + label::before {
@include stripes(
$uninstallStripeColor1,
$uninstallStripeColor2);
$uninstallStripeColor2,
$switchBackgroundOff);
// Reverse the stripe direction without
// impacting the animation speed.
transform: scaleX(-1);
Expand Down Expand Up @@ -163,7 +164,8 @@ $installStripeColor2: #00c42e;
&::before {
@include stripes(
$installStripeColor1,
$installStripeColor2);
$installStripeColor2,
$switchBackgroundOn);
}
&::after {
transform: translateX($switchHandleActivePosition);
Expand Down
14 changes: 14 additions & 0 deletions tests/client/disco/components/TestAddon.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,13 @@ describe('<Addon />', () => {
const { uninstall } = mapDispatchToProps(dispatch, { _addonManager: fakeAddonManager });
return uninstall({ guid, installURL })
.then(() => {
assert(dispatch.calledWith({
type: INSTALL_STATE,
payload: {
guid,
status: UNINSTALLING,
},
}));
assert(fakeAddonManager.uninstall.calledWith(guid));
});
});
Expand All @@ -746,6 +753,13 @@ describe('<Addon />', () => {
const { uninstall } = mapDispatchToProps(dispatch, { _addonManager: fakeAddonManager });
return uninstall({ guid, installURL })
.then(() => {
assert(dispatch.calledWith({
type: INSTALL_STATE,
payload: {
guid,
status: UNINSTALLING,
},
}));
assert(dispatch.calledWith({
type: INSTALL_STATE,
payload: { guid, status: ERROR, error: FATAL_UNINSTALL_ERROR },
Expand Down