mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
fixed #501: Lambda destination disable if api key missing
This commit is contained in:
parent
3d4d23903b
commit
c4f4efc533
4 changed files with 17 additions and 2 deletions
|
@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using ShareX.UploadersLib.Properties;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
|
@ -45,7 +46,7 @@ public override UploadResult Upload(Stream stream, string fileName)
|
|||
{
|
||||
if (string.IsNullOrEmpty(Config.UserAPIKey))
|
||||
{
|
||||
Errors.Add("Missing API key. Set one in destination settings.");
|
||||
Errors.Add(Resources.Lambda_Upload_Missing_API_key__Set_one_in_destination_settings_);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
11
ShareX.UploadersLib/Properties/Resources.Designer.cs
generated
11
ShareX.UploadersLib/Properties/Resources.Designer.cs
generated
|
@ -1,7 +1,7 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.0
|
||||
// Runtime Version:4.0.30319.34209
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
|
@ -421,6 +421,15 @@ internal static System.Drawing.Icon Lambda {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Missing API key. Set one in destination settings..
|
||||
/// </summary>
|
||||
internal static string Lambda_Upload_Missing_API_key__Set_one_in_destination_settings_ {
|
||||
get {
|
||||
return ResourceManager.GetString("Lambda_Upload_Missing_API_key__Set_one_in_destination_settings_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
|
|
@ -472,4 +472,7 @@ Created folders:</value>
|
|||
<data name="Hubic" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Favicons\hubic.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Lambda_Upload_Missing_API_key__Set_one_in_destination_settings_" xml:space="preserve">
|
||||
<value>Missing API key. Set one in destination settings.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -414,6 +414,8 @@ public bool IsValid(FileDestination destination)
|
|||
return !string.IsNullOrEmpty(OwnCloudHost) && !string.IsNullOrEmpty(OwnCloudUsername) && !string.IsNullOrEmpty(OwnCloudPassword);
|
||||
case FileDestination.MediaFire:
|
||||
return !string.IsNullOrEmpty(MediaFireUsername) && !string.IsNullOrEmpty(MediaFirePassword);
|
||||
case FileDestination.Lambda:
|
||||
return LambdaSettings != null && !string.IsNullOrEmpty(LambdaSettings.UserAPIKey);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue